chore: don't duplicate devtools constants (#24440)
This commit is contained in:
parent
7fd96cd188
commit
446100cdfe
2 changed files with 6 additions and 13 deletions
|
@ -6,18 +6,13 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "chrome/common/webui_url_constants.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "shell/browser/ui/devtools_ui.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
const char kChromeUIDevToolsBundledHost[] = "devtools";
|
||||
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
ElectronWebUIControllerFactory* ElectronWebUIControllerFactory::GetInstance() {
|
||||
return base::Singleton<ElectronWebUIControllerFactory>::get();
|
||||
|
@ -30,7 +25,7 @@ ElectronWebUIControllerFactory::~ElectronWebUIControllerFactory() = default;
|
|||
content::WebUI::TypeID ElectronWebUIControllerFactory::GetWebUIType(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& url) {
|
||||
if (url.host() == kChromeUIDevToolsBundledHost) {
|
||||
if (url.host() == chrome::kChromeUIDevToolsHost) {
|
||||
return const_cast<ElectronWebUIControllerFactory*>(this);
|
||||
}
|
||||
|
||||
|
@ -53,7 +48,7 @@ std::unique_ptr<content::WebUIController>
|
|||
ElectronWebUIControllerFactory::CreateWebUIControllerForURL(
|
||||
content::WebUI* web_ui,
|
||||
const GURL& url) {
|
||||
if (url.host() == kChromeUIDevToolsBundledHost) {
|
||||
if (url.host() == chrome::kChromeUIDevToolsHost) {
|
||||
auto* browser_context = web_ui->GetWebContents()->GetBrowserContext();
|
||||
return std::make_unique<DevToolsUI>(browser_context, web_ui);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue