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

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

Issue 972123003: Fixed behavior in case of disabled devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed conflict Created 5 years, 10 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
Index: chrome/browser/devtools/devtools_window.h
diff --git a/chrome/browser/devtools/devtools_window.h b/chrome/browser/devtools/devtools_window.h
index d0a4d3b0b2f6fa4f1ef40cdb3f906126713899a2..990fb85d7d22597250510984206a41c60055b821 100644
--- a/chrome/browser/devtools/devtools_window.h
+++ b/chrome/browser/devtools/devtools_window.h
@@ -64,17 +64,27 @@ class DevToolsWindow : public DevToolsUIBindings::Delegate,
static DevToolsWindow* AsDevToolsWindow(content::WebContents* web_contents);
// Open or reveal DevTools window, and perform the specified action.
- static DevToolsWindow* OpenDevToolsWindow(
- content::WebContents* inspected_web_contents,
- const DevToolsToggleAction& action);
+ // How to get pointer to the created window see comments for
+ // ToggleDevToolsWindow().
+ static void OpenDevToolsWindow(content::WebContents* inspected_web_contents,
+ const DevToolsToggleAction& action);
// Open or reveal DevTools window, with no special action.
- static DevToolsWindow* OpenDevToolsWindow(
- content::WebContents* inspected_web_contents);
+ // How to get pointer to the created window see comments for
+ // ToggleDevToolsWindow().
+ static void OpenDevToolsWindow(content::WebContents* inspected_web_contents);
// Perform specified action for current WebContents inside a |browser|.
// This may close currently open DevTools window.
- static DevToolsWindow* ToggleDevToolsWindow(
+ // If DeveloperToolsDisabled policy is set, no DevTools window created.
+ // In case if needed pointer to the created window one should use
+ // DevToolsAgentHost and DevToolsWindow::FindDevToolsWindow(). E.g.
+ // scoped_refptr<content::DevToolsAgentHost> agent(
dgozman 2015/03/10 05:43:24 Please surround code snippet with blank lines and
+ // content::DevToolsAgentHost::GetOrCreateFor(inspected_web_contents));
+ // DevToolsWindow::ToggleDevToolsWindow(
+ // inspected_web_contents, DevToolsToggleAction::Show());
+ // DevToolsWindow* window = DevToolsWindow::FindDevToolsWindow(agent.get());
+ static void ToggleDevToolsWindow(
Browser* browser,
const DevToolsToggleAction& action);
@@ -180,6 +190,8 @@ class DevToolsWindow : public DevToolsUIBindings::Delegate,
// by user.
static void OnPageCloseCanceled(content::WebContents* contents);
+ static DevToolsWindow* FindDevToolsWindow(content::DevToolsAgentHost*);
dgozman 2015/03/10 05:43:24 Please move this method near |AsDevToolsWindow| in
+
private:
friend class DevToolsWindowTesting;
@@ -223,9 +235,9 @@ class DevToolsWindow : public DevToolsUIBindings::Delegate,
const std::string& remote_frontend,
bool can_dock,
const std::string& settings);
- static DevToolsWindow* FindDevToolsWindow(content::DevToolsAgentHost*);
+
static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile);
- static DevToolsWindow* ToggleDevToolsWindow(
+ static void ToggleDevToolsWindow(
content::WebContents* web_contents,
bool force_open,
const DevToolsToggleAction& action,

Powered by Google App Engine
This is Rietveld 408576698