OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_DEBUGGER_DEVTOOLS_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ |
6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ | 6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "chrome/browser/debugger/devtools_client_host.h" | 12 #include "chrome/browser/debugger/devtools_client_host.h" |
13 #include "chrome/browser/debugger/devtools_toggle_action.h" | 13 #include "chrome/browser/debugger/devtools_toggle_action.h" |
14 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 14 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
15 #include "chrome/common/notification_observer.h" | 15 #include "chrome/common/notification_observer.h" |
16 #include "chrome/common/notification_registrar.h" | 16 #include "chrome/common/notification_registrar.h" |
17 #include "chrome/common/notification_service.h" | 17 #include "chrome/common/notification_service.h" |
18 | 18 |
19 namespace IPC { | 19 namespace IPC { |
20 class Message; | 20 class Message; |
21 } | 21 } |
22 | 22 |
23 class Browser; | 23 class Browser; |
24 class BrowserWindow; | 24 class BrowserWindow; |
25 class Profile; | 25 class Profile; |
26 class RenderViewHost; | 26 class RenderViewHost; |
27 class TabContents; | 27 class TabContentsWrapper; |
28 class Value; | 28 class Value; |
29 | 29 |
30 class DevToolsWindow | 30 class DevToolsWindow |
31 : public DevToolsClientHost, | 31 : public DevToolsClientHost, |
32 public NotificationObserver, | 32 public NotificationObserver, |
33 public TabContentsDelegate { | 33 public TabContentsDelegate { |
34 public: | 34 public: |
35 static const char kDevToolsApp[]; | 35 static const char kDevToolsApp[]; |
36 static TabContents* GetDevToolsContents(TabContents* inspected_tab); | 36 static TabContents* GetDevToolsContents(TabContents* inspected_tab); |
37 | 37 |
38 DevToolsWindow(Profile* profile, RenderViewHost* inspected_rvh, bool docked); | 38 DevToolsWindow(Profile* profile, RenderViewHost* inspected_rvh, bool docked); |
39 virtual ~DevToolsWindow(); | 39 virtual ~DevToolsWindow(); |
40 | 40 |
41 // Overridden from DevToolsClientHost. | 41 // Overridden from DevToolsClientHost. |
42 virtual DevToolsWindow* AsDevToolsWindow(); | 42 virtual DevToolsWindow* AsDevToolsWindow(); |
43 virtual void SendMessageToClient(const IPC::Message& message); | 43 virtual void SendMessageToClient(const IPC::Message& message); |
44 virtual void InspectedTabClosing(); | 44 virtual void InspectedTabClosing(); |
45 | 45 |
46 void Show(DevToolsToggleAction action); | 46 void Show(DevToolsToggleAction action); |
47 void Activate(); | 47 void Activate(); |
48 void SetDocked(bool docked); | 48 void SetDocked(bool docked); |
49 RenderViewHost* GetRenderViewHost(); | 49 RenderViewHost* GetRenderViewHost(); |
50 | 50 |
51 TabContents* tab_contents() { return tab_contents_; } | 51 TabContentsWrapper* tab_contents() { return tab_contents_; } |
52 Browser* browser() { return browser_; } // For tests. | 52 Browser* browser() { return browser_; } // For tests. |
53 bool is_docked() { return docked_; } | 53 bool is_docked() { return docked_; } |
54 | 54 |
55 private: | 55 private: |
56 void CreateDevToolsBrowser(); | 56 void CreateDevToolsBrowser(); |
57 bool FindInspectedBrowserAndTabIndex(Browser**, int* tab); | 57 bool FindInspectedBrowserAndTabIndex(Browser**, int* tab); |
58 BrowserWindow* GetInspectedBrowserWindow(); | 58 BrowserWindow* GetInspectedBrowserWindow(); |
59 void SetAttachedWindow(); | 59 void SetAttachedWindow(); |
60 | 60 |
61 // Overridden from NotificationObserver. | 61 // Overridden from NotificationObserver. |
(...skipping 29 matching lines...) Expand all Loading... |
91 virtual bool CanReloadContents(TabContents* source) const { return false; } | 91 virtual bool CanReloadContents(TabContents* source) const { return false; } |
92 virtual void URLStarredChanged(TabContents* source, bool starred) {} | 92 virtual void URLStarredChanged(TabContents* source, bool starred) {} |
93 virtual void UpdateTargetURL(TabContents* source, const GURL& url) {} | 93 virtual void UpdateTargetURL(TabContents* source, const GURL& url) {} |
94 virtual void ToolbarSizeChanged(TabContents* source, bool is_animating) {} | 94 virtual void ToolbarSizeChanged(TabContents* source, bool is_animating) {} |
95 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 95 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
96 bool* is_keyboard_shortcut); | 96 bool* is_keyboard_shortcut); |
97 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 97 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
98 | 98 |
99 Profile* profile_; | 99 Profile* profile_; |
100 TabContents* inspected_tab_; | 100 TabContents* inspected_tab_; |
101 TabContents* tab_contents_; | 101 TabContentsWrapper* tab_contents_; |
102 Browser* browser_; | 102 Browser* browser_; |
103 bool docked_; | 103 bool docked_; |
104 bool is_loaded_; | 104 bool is_loaded_; |
105 DevToolsToggleAction action_on_load_; | 105 DevToolsToggleAction action_on_load_; |
106 NotificationRegistrar registrar_; | 106 NotificationRegistrar registrar_; |
107 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); | 107 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); |
108 }; | 108 }; |
109 | 109 |
110 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ | 110 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ |
OLD | NEW |