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

Side by Side Diff: chrome/browser/devtools/devtools_window.h

Issue 442303002: DevTools: migrate DevTools APIs to use WebContents instead of RenderViewHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_
7 7
8 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" 8 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"
9 #include "chrome/browser/devtools/devtools_toggle_action.h" 9 #include "chrome/browser/devtools/devtools_toggle_action.h"
10 #include "chrome/browser/devtools/devtools_ui_bindings.h" 10 #include "chrome/browser/devtools/devtools_ui_bindings.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // For immediately-ready-to-use but maybe not yet fully initialized DevTools 58 // For immediately-ready-to-use but maybe not yet fully initialized DevTools
59 // use |GetInstanceForInspectedRenderViewHost| instead. 59 // use |GetInstanceForInspectedRenderViewHost| instead.
60 static content::WebContents* GetInTabWebContents( 60 static content::WebContents* GetInTabWebContents(
61 content::WebContents* inspected_tab, 61 content::WebContents* inspected_tab,
62 DevToolsContentsResizingStrategy* out_strategy); 62 DevToolsContentsResizingStrategy* out_strategy);
63 63
64 static bool IsDevToolsWindow(content::WebContents* web_contents); 64 static bool IsDevToolsWindow(content::WebContents* web_contents);
65 65
66 // Open or reveal DevTools window, and perform the specified action. 66 // Open or reveal DevTools window, and perform the specified action.
67 static DevToolsWindow* OpenDevToolsWindow( 67 static DevToolsWindow* OpenDevToolsWindow(
68 content::RenderViewHost* inspected_rvh, 68 content::WebContents* inspected_web_contents,
69 const DevToolsToggleAction& action); 69 const DevToolsToggleAction& action);
70 70
71 // Open or reveal DevTools window, with no special action. 71 // Open or reveal DevTools window, with no special action.
72 static DevToolsWindow* OpenDevToolsWindow( 72 static DevToolsWindow* OpenDevToolsWindow(
73 content::RenderViewHost* inspected_rvh); 73 content::WebContents* inspected_web_contents);
74 74
75 // Perform specified action for current WebContents inside a |browser|. 75 // Perform specified action for current WebContents inside a |browser|.
76 // This may close currently open DevTools window. 76 // This may close currently open DevTools window.
77 static DevToolsWindow* ToggleDevToolsWindow( 77 static DevToolsWindow* ToggleDevToolsWindow(
78 Browser* browser, 78 Browser* browser,
79 const DevToolsToggleAction& action); 79 const DevToolsToggleAction& action);
80 80
81 // External frontend is always undocked. 81 // External frontend is always undocked.
82 static void OpenExternalFrontend( 82 static void OpenExternalFrontend(
83 Profile* profile, 83 Profile* profile,
84 const std::string& frontend_uri, 84 const std::string& frontend_uri,
85 content::DevToolsAgentHost* agent_host); 85 content::DevToolsAgentHost* agent_host);
86 86
87 // Worker frontend is always undocked. 87 // Worker frontend is always undocked.
88 static DevToolsWindow* OpenDevToolsWindowForWorker( 88 static DevToolsWindow* OpenDevToolsWindowForWorker(
89 Profile* profile, 89 Profile* profile,
90 content::DevToolsAgentHost* worker_agent); 90 content::DevToolsAgentHost* worker_agent);
91 91
92 static void InspectElement( 92 static void InspectElement(
93 content::RenderViewHost* inspected_rvh, int x, int y); 93 content::WebContents* inspected_web_contents, int x, int y);
94 94
95 // Sets closure to be called after load is done. If already loaded, calls 95 // Sets closure to be called after load is done. If already loaded, calls
96 // closure immediately. 96 // closure immediately.
97 void SetLoadCompletedCallback(const base::Closure& closure); 97 void SetLoadCompletedCallback(const base::Closure& closure);
98 98
99 // Forwards an unhandled keyboard event to the DevTools frontend. 99 // Forwards an unhandled keyboard event to the DevTools frontend.
100 bool ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& event); 100 bool ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& event);
101 101
102 // BeforeUnload interception //////////////////////////////////////////////// 102 // BeforeUnload interception ////////////////////////////////////////////////
103 103
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 enum LifeStage { 192 enum LifeStage {
193 kNotLoaded, 193 kNotLoaded,
194 kOnLoadFired, // Implies SetIsDocked was not yet called. 194 kOnLoadFired, // Implies SetIsDocked was not yet called.
195 kIsDockedSet, // Implies DocumentOnLoadCompleted was not yet called. 195 kIsDockedSet, // Implies DocumentOnLoadCompleted was not yet called.
196 kLoadCompleted, 196 kLoadCompleted,
197 kClosing 197 kClosing
198 }; 198 };
199 199
200 DevToolsWindow(Profile* profile, 200 DevToolsWindow(Profile* profile,
201 const GURL& frontend_url, 201 const GURL& frontend_url,
202 content::RenderViewHost* inspected_rvh, 202 content::WebContents* inspected_web_contents,
203 bool can_dock); 203 bool can_dock);
204 204
205 static DevToolsWindow* Create(Profile* profile, 205 static DevToolsWindow* Create(Profile* profile,
206 const GURL& frontend_url, 206 const GURL& frontend_url,
207 content::RenderViewHost* inspected_rvh, 207 content::WebContents* inspected_web_contents,
208 bool shared_worker_frontend, 208 bool shared_worker_frontend,
209 bool external_frontend, 209 bool external_frontend,
210 bool can_dock, 210 bool can_dock,
211 const std::string& settings); 211 const std::string& settings);
212 static GURL GetDevToolsURL(Profile* profile, 212 static GURL GetDevToolsURL(Profile* profile,
213 const GURL& base_url, 213 const GURL& base_url,
214 bool shared_worker_frontend, 214 bool shared_worker_frontend,
215 bool external_frontend, 215 bool external_frontend,
216 bool can_dock, 216 bool can_dock,
217 const std::string& settings); 217 const std::string& settings);
218 static DevToolsWindow* FindDevToolsWindow(content::DevToolsAgentHost*); 218 static DevToolsWindow* FindDevToolsWindow(content::DevToolsAgentHost*);
219 static DevToolsWindow* AsDevToolsWindow(content::WebContents*); 219 static DevToolsWindow* AsDevToolsWindow(content::WebContents*);
220 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile); 220 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile);
221 static DevToolsWindow* ToggleDevToolsWindow( 221 static DevToolsWindow* ToggleDevToolsWindow(
222 content::RenderViewHost* inspected_rvh, 222 content::WebContents* web_contents,
223 bool force_open, 223 bool force_open,
224 const DevToolsToggleAction& action, 224 const DevToolsToggleAction& action,
225 const std::string& settings); 225 const std::string& settings);
226 226
227 static std::string GetDevToolsWindowPlacementPrefKey(); 227 static std::string GetDevToolsWindowPlacementPrefKey();
228 228
229 // content::WebContentsDelegate: 229 // content::WebContentsDelegate:
230 virtual content::WebContents* OpenURLFromTab( 230 virtual content::WebContents* OpenURLFromTab(
231 content::WebContents* source, 231 content::WebContents* source,
232 const content::OpenURLParams& params) OVERRIDE; 232 const content::OpenURLParams& params) OVERRIDE;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 base::Closure close_callback_; 313 base::Closure close_callback_;
314 314
315 base::TimeTicks inspect_element_start_time_; 315 base::TimeTicks inspect_element_start_time_;
316 scoped_ptr<DevToolsEventForwarder> event_forwarder_; 316 scoped_ptr<DevToolsEventForwarder> event_forwarder_;
317 317
318 friend class DevToolsEventForwarder; 318 friend class DevToolsEventForwarder;
319 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); 319 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow);
320 }; 320 };
321 321
322 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ 322 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698