Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: chrome/browser/devtools/devtools_window.cc

Issue 2939173002: Reland of [DevTools] Show icon in top toolbar when Node target is available (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/devtools/devtools_window.h ('k') | content/browser/devtools/protocol/target_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_window.cc
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc
index 2719db351b6c455a1b0481567468eccfb5d8b5ca..dc0dfd6e4dd8a7e3a9741b2d1d4474cb2288a995 100644
--- a/chrome/browser/devtools/devtools_window.cc
+++ b/chrome/browser/devtools/devtools_window.cc
@@ -585,6 +585,13 @@
// static
void DevToolsWindow::OpenNodeFrontendWindow(Profile* profile) {
+ for (DevToolsWindow* window : g_instances.Get()) {
+ if (window->frontend_type_ == kFrontendNode) {
+ window->ActivateWindow();
+ return;
+ }
+ }
+
DevToolsWindow* window =
Create(profile, nullptr, kFrontendNode, std::string(), false,
std::string(), std::string());
@@ -806,12 +813,14 @@
DevToolsWindow::OnPageCloseCanceled(window->main_web_contents_);
}
-DevToolsWindow::DevToolsWindow(Profile* profile,
+DevToolsWindow::DevToolsWindow(FrontendType frontend_type,
+ Profile* profile,
WebContents* main_web_contents,
DevToolsUIBindings* bindings,
WebContents* inspected_web_contents,
bool can_dock)
- : profile_(profile),
+ : frontend_type_(frontend_type),
+ profile_(profile),
main_web_contents_(main_web_contents),
toolbox_web_contents_(nullptr),
bindings_(bindings),
@@ -906,8 +915,8 @@
return nullptr;
if (!settings.empty())
SetPreferencesFromJson(profile, settings);
- return new DevToolsWindow(profile, main_web_contents.release(), bindings,
- inspected_web_contents, can_dock);
+ return new DevToolsWindow(frontend_type, profile, main_web_contents.release(),
+ bindings, inspected_web_contents, can_dock);
}
// static
« no previous file with comments | « chrome/browser/devtools/devtools_window.h ('k') | content/browser/devtools/protocol/target_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698