chore: don't duplicate devtools constants (#24440)

This commit is contained in:
Shelley Vohr 2020-07-07 14:04:23 -07:00 committed by GitHub
parent 7fd96cd188
commit 446100cdfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 13 deletions

View file

@ -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);
}