OLD | NEW |
---|---|
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 "base/memory/scoped_ptr.h" | |
8 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" | 9 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" |
9 #include "chrome/browser/devtools/devtools_toggle_action.h" | 10 #include "chrome/browser/devtools/devtools_toggle_action.h" |
10 #include "chrome/browser/devtools/devtools_ui_bindings.h" | 11 #include "chrome/browser/devtools/devtools_ui_bindings.h" |
11 #include "content/public/browser/web_contents_delegate.h" | 12 #include "content/public/browser/web_contents_delegate.h" |
12 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
14 #include "extensions/browser/extension_function_dispatcher.h" | |
13 | 15 |
14 class Browser; | 16 class Browser; |
15 class BrowserWindow; | 17 class BrowserWindow; |
16 class DevToolsControllerTest; | 18 class DevToolsControllerTest; |
17 class DevToolsEventForwarder; | 19 class DevToolsEventForwarder; |
18 | 20 |
19 namespace content { | 21 namespace content { |
20 class DevToolsAgentHost; | 22 class DevToolsAgentHost; |
21 struct NativeWebKeyboardEvent; | 23 struct NativeWebKeyboardEvent; |
22 class RenderViewHost; | 24 class RenderViewHost; |
23 } | 25 } |
24 | 26 |
25 namespace user_prefs { | 27 namespace user_prefs { |
26 class PrefRegistrySyncable; | 28 class PrefRegistrySyncable; |
27 } | 29 } |
28 | 30 |
29 class DevToolsWindow : public DevToolsUIBindings::Delegate, | 31 class DevToolsWindow |
30 public content::WebContentsDelegate { | 32 : public DevToolsUIBindings::Delegate, |
33 public content::WebContentsDelegate, | |
34 public extensions::ExtensionFunctionDispatcher::Delegate { | |
pfeldman
2014/07/10 13:44:36
You probably want to add this aspect to DevToolsUI
| |
31 public: | 35 public: |
32 class ObserverWithAccessor : public content::WebContentsObserver { | 36 class ObserverWithAccessor : public content::WebContentsObserver { |
33 public: | 37 public: |
34 explicit ObserverWithAccessor(content::WebContents* web_contents); | 38 explicit ObserverWithAccessor(content::WebContents* web_contents); |
35 virtual ~ObserverWithAccessor(); | 39 virtual ~ObserverWithAccessor(); |
36 content::WebContents* GetWebContents(); | 40 content::WebContents* GetWebContents(); |
37 | 41 |
38 private: | 42 private: |
39 DISALLOW_COPY_AND_ASSIGN(ObserverWithAccessor); | 43 DISALLOW_COPY_AND_ASSIGN(ObserverWithAccessor); |
40 }; | 44 }; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 virtual void InspectElementCompleted() OVERRIDE; | 283 virtual void InspectElementCompleted() OVERRIDE; |
280 virtual void MoveWindow(int x, int y) OVERRIDE; | 284 virtual void MoveWindow(int x, int y) OVERRIDE; |
281 virtual void SetIsDocked(bool is_docked) OVERRIDE; | 285 virtual void SetIsDocked(bool is_docked) OVERRIDE; |
282 virtual void OpenInNewTab(const std::string& url) OVERRIDE; | 286 virtual void OpenInNewTab(const std::string& url) OVERRIDE; |
283 virtual void SetWhitelistedShortcuts(const std::string& message) OVERRIDE; | 287 virtual void SetWhitelistedShortcuts(const std::string& message) OVERRIDE; |
284 virtual void InspectedContentsClosing() OVERRIDE; | 288 virtual void InspectedContentsClosing() OVERRIDE; |
285 virtual void OnLoadCompleted() OVERRIDE; | 289 virtual void OnLoadCompleted() OVERRIDE; |
286 virtual InfoBarService* GetInfoBarService() OVERRIDE; | 290 virtual InfoBarService* GetInfoBarService() OVERRIDE; |
287 virtual void RenderProcessGone() OVERRIDE; | 291 virtual void RenderProcessGone() OVERRIDE; |
288 | 292 |
293 // extensions::ExtensionFunctionDispatcher::Delegate overrides | |
294 virtual extensions::WindowController* GetExtensionWindowController() | |
295 const OVERRIDE; | |
296 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; | |
297 virtual content::WebContents* GetVisibleWebContents() const OVERRIDE; | |
298 | |
289 void CreateDevToolsBrowser(); | 299 void CreateDevToolsBrowser(); |
290 BrowserWindow* GetInspectedBrowserWindow(); | 300 BrowserWindow* GetInspectedBrowserWindow(); |
291 void ScheduleShow(const DevToolsToggleAction& action); | 301 void ScheduleShow(const DevToolsToggleAction& action); |
292 void Show(const DevToolsToggleAction& action); | 302 void Show(const DevToolsToggleAction& action); |
293 void DoAction(const DevToolsToggleAction& action); | 303 void DoAction(const DevToolsToggleAction& action); |
294 void LoadCompleted(); | 304 void LoadCompleted(); |
295 void SetIsDockedAndShowImmediatelyForTest(bool is_docked); | 305 void SetIsDockedAndShowImmediatelyForTest(bool is_docked); |
296 void UpdateBrowserToolbar(); | 306 void UpdateBrowserToolbar(); |
297 void UpdateBrowserWindow(); | 307 void UpdateBrowserWindow(); |
298 content::WebContents* GetInspectedWebContents(); | 308 content::WebContents* GetInspectedWebContents(); |
(...skipping 12 matching lines...) Expand all Loading... | |
311 bool ignore_set_is_docked_; | 321 bool ignore_set_is_docked_; |
312 DevToolsContentsResizingStrategy contents_resizing_strategy_; | 322 DevToolsContentsResizingStrategy contents_resizing_strategy_; |
313 // True if we're in the process of handling a beforeunload event originating | 323 // True if we're in the process of handling a beforeunload event originating |
314 // from the inspected webcontents, see InterceptPageBeforeUnload for details. | 324 // from the inspected webcontents, see InterceptPageBeforeUnload for details. |
315 bool intercepted_page_beforeunload_; | 325 bool intercepted_page_beforeunload_; |
316 base::Closure load_completed_callback_; | 326 base::Closure load_completed_callback_; |
317 | 327 |
318 base::TimeTicks inspect_element_start_time_; | 328 base::TimeTicks inspect_element_start_time_; |
319 scoped_ptr<DevToolsEventForwarder> event_forwarder_; | 329 scoped_ptr<DevToolsEventForwarder> event_forwarder_; |
320 | 330 |
331 scoped_ptr<extensions::ExtensionFunctionDispatcher> extension_dispatcher_; | |
332 | |
321 friend class DevToolsEventForwarder; | 333 friend class DevToolsEventForwarder; |
322 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); | 334 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); |
323 }; | 335 }; |
324 | 336 |
325 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 337 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
OLD | NEW |