Remove devtools window runner abstraction (see #3685)
Remove code abstractions that are no longer required after deletion of the Alloy bootstrap. This is a functional no-op.
This commit is contained in:
parent
cd3f617171
commit
1cdf02815e
4
BUILD.gn
4
BUILD.gn
|
@ -514,8 +514,6 @@ source_set("libcef_static") {
|
||||||
"libcef/browser/chrome/chrome_content_browser_client_cef.h",
|
"libcef/browser/chrome/chrome_content_browser_client_cef.h",
|
||||||
"libcef/browser/chrome/chrome_context_menu_handler.cc",
|
"libcef/browser/chrome/chrome_context_menu_handler.cc",
|
||||||
"libcef/browser/chrome/chrome_context_menu_handler.h",
|
"libcef/browser/chrome/chrome_context_menu_handler.h",
|
||||||
"libcef/browser/chrome/chrome_devtools_window_runner.cc",
|
|
||||||
"libcef/browser/chrome/chrome_devtools_window_runner.h",
|
|
||||||
"libcef/browser/chrome/chrome_startup_browser_creator.cc",
|
"libcef/browser/chrome/chrome_startup_browser_creator.cc",
|
||||||
"libcef/browser/chrome/chrome_startup_browser_creator.h",
|
"libcef/browser/chrome/chrome_startup_browser_creator.h",
|
||||||
"libcef/browser/chrome/chrome_web_contents_view_delegate_cef.h",
|
"libcef/browser/chrome/chrome_web_contents_view_delegate_cef.h",
|
||||||
|
@ -548,8 +546,8 @@ source_set("libcef_static") {
|
||||||
"libcef/browser/devtools/devtools_controller.h",
|
"libcef/browser/devtools/devtools_controller.h",
|
||||||
"libcef/browser/devtools/devtools_protocol_manager.cc",
|
"libcef/browser/devtools/devtools_protocol_manager.cc",
|
||||||
"libcef/browser/devtools/devtools_protocol_manager.h",
|
"libcef/browser/devtools/devtools_protocol_manager.h",
|
||||||
|
"libcef/browser/devtools/devtools_window_runner.cc",
|
||||||
"libcef/browser/devtools/devtools_window_runner.h",
|
"libcef/browser/devtools/devtools_window_runner.h",
|
||||||
"libcef/browser/devtools/devtools_window_runner_create.cc",
|
|
||||||
"libcef/browser/download_item_impl.cc",
|
"libcef/browser/download_item_impl.cc",
|
||||||
"libcef/browser/download_item_impl.h",
|
"libcef/browser/download_item_impl.h",
|
||||||
"libcef/browser/download_manager_delegate.cc",
|
"libcef/browser/download_manager_delegate.cc",
|
||||||
|
|
|
@ -1360,7 +1360,7 @@ CefMediaStreamRegistrar* CefBrowserHostBase::GetMediaStreamRegistrar() {
|
||||||
|
|
||||||
CefDevToolsWindowRunner* CefBrowserHostBase::GetDevToolsWindowRunner() {
|
CefDevToolsWindowRunner* CefBrowserHostBase::GetDevToolsWindowRunner() {
|
||||||
if (!devtools_window_runner_) {
|
if (!devtools_window_runner_) {
|
||||||
devtools_window_runner_ = CefDevToolsWindowRunner::Create();
|
devtools_window_runner_ = std::make_unique<CefDevToolsWindowRunner>();
|
||||||
}
|
}
|
||||||
return devtools_window_runner_.get();
|
return devtools_window_runner_.get();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
#include "cef/libcef/browser/browser_platform_delegate.h"
|
#include "cef/libcef/browser/browser_platform_delegate.h"
|
||||||
#include "cef/libcef/browser/chrome/chrome_browser_context.h"
|
#include "cef/libcef/browser/chrome/chrome_browser_context.h"
|
||||||
#include "cef/libcef/browser/chrome/chrome_browser_host_impl.h"
|
#include "cef/libcef/browser/chrome/chrome_browser_host_impl.h"
|
||||||
#include "cef/libcef/browser/chrome/chrome_devtools_window_runner.h"
|
|
||||||
#include "cef/libcef/browser/chrome/views/chrome_browser_view.h"
|
#include "cef/libcef/browser/chrome/views/chrome_browser_view.h"
|
||||||
#include "cef/libcef/browser/chrome/views/chrome_child_window.h"
|
#include "cef/libcef/browser/chrome/views/chrome_child_window.h"
|
||||||
|
#include "cef/libcef/browser/devtools/devtools_window_runner.h"
|
||||||
#include "cef/libcef/browser/hang_monitor.h"
|
#include "cef/libcef/browser/hang_monitor.h"
|
||||||
#include "cef/libcef/browser/media_access_query.h"
|
#include "cef/libcef/browser/media_access_query.h"
|
||||||
#include "cef/libcef/browser/request_context_impl.h"
|
#include "cef/libcef/browser/request_context_impl.h"
|
||||||
|
@ -98,8 +98,7 @@ Browser* ChromeBrowserDelegate::CreateDevToolsBrowser(
|
||||||
CefBrowserCreateParams create_params;
|
CefBrowserCreateParams create_params;
|
||||||
CefWindowInfo window_info;
|
CefWindowInfo window_info;
|
||||||
|
|
||||||
auto* devtools_window_runner = static_cast<ChromeDevToolsWindowRunner*>(
|
auto* devtools_window_runner = opener_browser_host->GetDevToolsWindowRunner();
|
||||||
opener_browser_host->GetDevToolsWindowRunner());
|
|
||||||
auto pending_show_devtools_params =
|
auto pending_show_devtools_params =
|
||||||
devtools_window_runner->TakePendingParams();
|
devtools_window_runner->TakePendingParams();
|
||||||
|
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
// Copyright 2024 The Chromium Embedded Framework Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef CEF_LIBCEF_BROWSER_CHROME_CHROME_DEVTOOLS_WINDOW_RUNNER_H_
|
|
||||||
#define CEF_LIBCEF_BROWSER_CHROME_CHROME_DEVTOOLS_WINDOW_RUNNER_H_
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "base/memory/weak_ptr.h"
|
|
||||||
#include "cef/libcef/browser/devtools/devtools_window_runner.h"
|
|
||||||
|
|
||||||
class ChromeBrowserHostImpl;
|
|
||||||
|
|
||||||
// Creates and runs a DevTools window instance. Only accessed on the UI thread.
|
|
||||||
class ChromeDevToolsWindowRunner : public CefDevToolsWindowRunner {
|
|
||||||
public:
|
|
||||||
ChromeDevToolsWindowRunner() = default;
|
|
||||||
|
|
||||||
ChromeDevToolsWindowRunner(const ChromeDevToolsWindowRunner&) = delete;
|
|
||||||
ChromeDevToolsWindowRunner& operator=(const ChromeDevToolsWindowRunner&) =
|
|
||||||
delete;
|
|
||||||
|
|
||||||
// CefDevToolsWindowRunner methods:
|
|
||||||
void ShowDevTools(CefBrowserHostBase* opener,
|
|
||||||
std::unique_ptr<CefShowDevToolsParams> params) override;
|
|
||||||
void CloseDevTools() override;
|
|
||||||
bool HasDevTools() override;
|
|
||||||
|
|
||||||
std::unique_ptr<CefShowDevToolsParams> TakePendingParams();
|
|
||||||
|
|
||||||
void SetDevToolsBrowserHost(
|
|
||||||
base::WeakPtr<ChromeBrowserHostImpl> browser_host);
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::unique_ptr<CefShowDevToolsParams> pending_params_;
|
|
||||||
|
|
||||||
base::WeakPtr<ChromeBrowserHostImpl> browser_host_;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_BROWSER_CHROME_CHROME_DEVTOOLS_WINDOW_RUNNER_H_
|
|
|
@ -2,14 +2,14 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "cef/libcef/browser/chrome/chrome_devtools_window_runner.h"
|
#include "cef/libcef/browser/devtools/devtools_window_runner.h"
|
||||||
|
|
||||||
#include "cef/libcef/browser/chrome/chrome_browser_host_impl.h"
|
#include "cef/libcef/browser/chrome/chrome_browser_host_impl.h"
|
||||||
#include "cef/libcef/browser/request_context_impl.h"
|
#include "cef/libcef/browser/request_context_impl.h"
|
||||||
#include "cef/libcef/browser/thread_util.h"
|
#include "cef/libcef/browser/thread_util.h"
|
||||||
#include "chrome/browser/devtools/devtools_window.h"
|
#include "chrome/browser/devtools/devtools_window.h"
|
||||||
|
|
||||||
void ChromeDevToolsWindowRunner::ShowDevTools(
|
void CefDevToolsWindowRunner::ShowDevTools(
|
||||||
CefBrowserHostBase* opener,
|
CefBrowserHostBase* opener,
|
||||||
std::unique_ptr<CefShowDevToolsParams> params) {
|
std::unique_ptr<CefShowDevToolsParams> params) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
|
@ -46,7 +46,7 @@ void ChromeDevToolsWindowRunner::ShowDevTools(
|
||||||
DCHECK(browser_host_);
|
DCHECK(browser_host_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChromeDevToolsWindowRunner::CloseDevTools() {
|
void CefDevToolsWindowRunner::CloseDevTools() {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
if (browser_host_) {
|
if (browser_host_) {
|
||||||
browser_host_->TryCloseBrowser();
|
browser_host_->TryCloseBrowser();
|
||||||
|
@ -54,18 +54,18 @@ void ChromeDevToolsWindowRunner::CloseDevTools() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChromeDevToolsWindowRunner::HasDevTools() {
|
bool CefDevToolsWindowRunner::HasDevTools() {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
return !!browser_host_;
|
return !!browser_host_;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CefShowDevToolsParams>
|
std::unique_ptr<CefShowDevToolsParams>
|
||||||
ChromeDevToolsWindowRunner::TakePendingParams() {
|
CefDevToolsWindowRunner::TakePendingParams() {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
return std::move(pending_params_);
|
return std::move(pending_params_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChromeDevToolsWindowRunner::SetDevToolsBrowserHost(
|
void CefDevToolsWindowRunner::SetDevToolsBrowserHost(
|
||||||
base::WeakPtr<ChromeBrowserHostImpl> browser_host) {
|
base::WeakPtr<ChromeBrowserHostImpl> browser_host) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
DCHECK(!browser_host_);
|
DCHECK(!browser_host_);
|
|
@ -8,9 +8,11 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include "base/memory/weak_ptr.h"
|
||||||
#include "cef/include/cef_client.h"
|
#include "cef/include/cef_client.h"
|
||||||
|
|
||||||
class CefBrowserHostBase;
|
class CefBrowserHostBase;
|
||||||
|
class ChromeBrowserHostImpl;
|
||||||
|
|
||||||
// Parameters passed to ShowDevTools.
|
// Parameters passed to ShowDevTools.
|
||||||
struct CefShowDevToolsParams {
|
struct CefShowDevToolsParams {
|
||||||
|
@ -30,18 +32,28 @@ struct CefShowDevToolsParams {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Creates and runs a DevTools window instance. Only accessed on the UI thread.
|
// Creates and runs a DevTools window instance. Only accessed on the UI thread.
|
||||||
class CefDevToolsWindowRunner {
|
class CefDevToolsWindowRunner final {
|
||||||
public:
|
public:
|
||||||
// Creates the appropriate runner type based on the current runtime.
|
CefDevToolsWindowRunner() = default;
|
||||||
static std::unique_ptr<CefDevToolsWindowRunner> Create();
|
|
||||||
|
|
||||||
// See documentation on CefBrowserHost methods of the same name.
|
CefDevToolsWindowRunner(const CefDevToolsWindowRunner&) = delete;
|
||||||
virtual void ShowDevTools(CefBrowserHostBase* opener,
|
CefDevToolsWindowRunner& operator=(const CefDevToolsWindowRunner&) =
|
||||||
std::unique_ptr<CefShowDevToolsParams> params) = 0;
|
delete;
|
||||||
virtual void CloseDevTools() = 0;
|
|
||||||
virtual bool HasDevTools() = 0;
|
|
||||||
|
|
||||||
virtual ~CefDevToolsWindowRunner() = default;
|
void ShowDevTools(CefBrowserHostBase* opener,
|
||||||
|
std::unique_ptr<CefShowDevToolsParams> params);
|
||||||
|
void CloseDevTools();
|
||||||
|
bool HasDevTools();
|
||||||
|
|
||||||
|
std::unique_ptr<CefShowDevToolsParams> TakePendingParams();
|
||||||
|
|
||||||
|
void SetDevToolsBrowserHost(
|
||||||
|
base::WeakPtr<ChromeBrowserHostImpl> browser_host);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<CefShowDevToolsParams> pending_params_;
|
||||||
|
|
||||||
|
base::WeakPtr<ChromeBrowserHostImpl> browser_host_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_RUNNER_H_
|
#endif // CEF_LIBCEF_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_RUNNER_H_
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
// Copyright 2024 The Chromium Embedded Framework Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#include "cef/libcef/browser/chrome/chrome_devtools_window_runner.h"
|
|
||||||
#include "cef/libcef/browser/devtools/devtools_window_runner.h"
|
|
||||||
|
|
||||||
// static
|
|
||||||
std::unique_ptr<CefDevToolsWindowRunner> CefDevToolsWindowRunner::Create() {
|
|
||||||
return std::make_unique<ChromeDevToolsWindowRunner>();
|
|
||||||
}
|
|
Loading…
Reference in New Issue