OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_BINDINGS_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ |
7 | 7 |
| 8 #include <map> |
8 #include <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
15 #include "chrome/browser/devtools/device/devtools_android_bridge.h" | |
16 #include "chrome/browser/devtools/devtools_embedder_message_dispatcher.h" | 16 #include "chrome/browser/devtools/devtools_embedder_message_dispatcher.h" |
17 #include "chrome/browser/devtools/devtools_file_helper.h" | 17 #include "chrome/browser/devtools/devtools_file_helper.h" |
18 #include "chrome/browser/devtools/devtools_file_system_indexer.h" | 18 #include "chrome/browser/devtools/devtools_file_system_indexer.h" |
19 #include "chrome/browser/devtools/devtools_targets_ui.h" | 19 #include "chrome/browser/devtools/devtools_targets_ui.h" |
20 #include "content/public/browser/devtools_agent_host.h" | 20 #include "content/public/browser/devtools_agent_host.h" |
21 #include "content/public/browser/devtools_frontend_host.h" | 21 #include "content/public/browser/devtools_frontend_host.h" |
22 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
23 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
24 #include "ui/gfx/size.h" | 24 #include "ui/gfx/size.h" |
25 | 25 |
| 26 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 27 #include "chrome/browser/devtools/device/devtools_android_bridge.h" |
| 28 #endif |
| 29 |
26 class InfoBarService; | 30 class InfoBarService; |
27 class Profile; | 31 class Profile; |
28 | 32 |
29 namespace content { | 33 namespace content { |
30 struct FileChooserParams; | 34 struct FileChooserParams; |
31 class WebContents; | 35 class WebContents; |
32 } | 36 } |
33 | 37 |
34 // Base implementation of DevTools bindings around front-end. | 38 // Base implementation of DevTools bindings around front-end. |
35 class DevToolsUIBindings : public content::NotificationObserver, | 39 class DevToolsUIBindings : public content::NotificationObserver, |
36 public content::DevToolsFrontendHost::Delegate, | 40 public content::DevToolsFrontendHost::Delegate, |
37 public DevToolsEmbedderMessageDispatcher::Delegate, | 41 public DevToolsEmbedderMessageDispatcher::Delegate, |
| 42 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
38 public DevToolsAndroidBridge::DeviceCountListener, | 43 public DevToolsAndroidBridge::DeviceCountListener, |
| 44 #endif |
39 public content::DevToolsAgentHostClient { | 45 public content::DevToolsAgentHostClient { |
40 public: | 46 public: |
41 static DevToolsUIBindings* ForWebContents( | 47 static DevToolsUIBindings* ForWebContents( |
42 content::WebContents* web_contents); | 48 content::WebContents* web_contents); |
43 static GURL ApplyThemeToURL(Profile* profile, const GURL& base_url); | 49 static GURL ApplyThemeToURL(Profile* profile, const GURL& base_url); |
44 | 50 |
45 class Delegate { | 51 class Delegate { |
46 public: | 52 public: |
47 virtual ~Delegate() {} | 53 virtual ~Delegate() {} |
48 virtual void ActivateWindow() = 0; | 54 virtual void ActivateWindow() = 0; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 void ZoomOut() override; | 131 void ZoomOut() override; |
126 void ResetZoom() override; | 132 void ResetZoom() override; |
127 void OpenUrlOnRemoteDeviceAndInspect(const std::string& browser_id, | 133 void OpenUrlOnRemoteDeviceAndInspect(const std::string& browser_id, |
128 const std::string& url) override; | 134 const std::string& url) override; |
129 void SetDeviceCountUpdatesEnabled(bool enabled) override; | 135 void SetDeviceCountUpdatesEnabled(bool enabled) override; |
130 void SetDevicesUpdatesEnabled(bool enabled) override; | 136 void SetDevicesUpdatesEnabled(bool enabled) override; |
131 void SendMessageToBrowser(const std::string& message) override; | 137 void SendMessageToBrowser(const std::string& message) override; |
132 | 138 |
133 void EnableRemoteDeviceCounter(bool enable); | 139 void EnableRemoteDeviceCounter(bool enable); |
134 | 140 |
| 141 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
135 // DevToolsAndroidBridge::DeviceCountListener override: | 142 // DevToolsAndroidBridge::DeviceCountListener override: |
136 void DeviceCountChanged(int count) override; | 143 void DeviceCountChanged(int count) override; |
| 144 #endif |
137 | 145 |
138 // Forwards discovered devices to frontend. | 146 // Forwards discovered devices to frontend. |
139 virtual void DevicesUpdated(const std::string& source, | 147 virtual void DevicesUpdated(const std::string& source, |
140 const base::ListValue& targets); | 148 const base::ListValue& targets); |
141 | 149 |
142 void DocumentOnLoadCompletedInMainFrame(); | 150 void DocumentOnLoadCompletedInMainFrame(); |
143 void DidNavigateMainFrame(); | 151 void DidNavigateMainFrame(); |
144 void FrontendLoaded(); | 152 void FrontendLoaded(); |
145 | 153 |
146 // DevToolsFileHelper callbacks. | 154 // DevToolsFileHelper callbacks. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 bool frontend_loaded_; | 199 bool frontend_loaded_; |
192 scoped_ptr<DevToolsTargetsUIHandler> remote_targets_handler_; | 200 scoped_ptr<DevToolsTargetsUIHandler> remote_targets_handler_; |
193 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; | 201 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; |
194 GURL url_; | 202 GURL url_; |
195 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; | 203 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; |
196 | 204 |
197 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); | 205 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); |
198 }; | 206 }; |
199 | 207 |
200 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ | 208 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ |
OLD | NEW |