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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Base implementation of DevTools bindings around front-end. | 35 // Base implementation of DevTools bindings around front-end. |
36 class DevToolsUIBindings : public DevToolsEmbedderMessageDispatcher::Delegate, | 36 class DevToolsUIBindings : public DevToolsEmbedderMessageDispatcher::Delegate, |
37 public DevToolsAndroidBridge::DeviceCountListener, | 37 public DevToolsAndroidBridge::DeviceCountListener, |
38 public content::DevToolsAgentHostClient, | 38 public content::DevToolsAgentHostClient, |
39 public net::URLFetcherDelegate, | 39 public net::URLFetcherDelegate, |
40 public DevToolsFileHelper::Delegate { | 40 public DevToolsFileHelper::Delegate { |
41 public: | 41 public: |
42 static DevToolsUIBindings* ForWebContents( | 42 static DevToolsUIBindings* ForWebContents( |
43 content::WebContents* web_contents); | 43 content::WebContents* web_contents); |
44 | 44 |
| 45 static GURL SanitizeFrontendURL(const GURL& url); |
| 46 |
45 class Delegate { | 47 class Delegate { |
46 public: | 48 public: |
47 virtual ~Delegate() {} | 49 virtual ~Delegate() {} |
48 virtual void ActivateWindow() = 0; | 50 virtual void ActivateWindow() = 0; |
49 virtual void CloseWindow() = 0; | 51 virtual void CloseWindow() = 0; |
50 virtual void Inspect(scoped_refptr<content::DevToolsAgentHost> host) = 0; | 52 virtual void Inspect(scoped_refptr<content::DevToolsAgentHost> host) = 0; |
51 virtual void SetInspectedPageBounds(const gfx::Rect& rect) = 0; | 53 virtual void SetInspectedPageBounds(const gfx::Rect& rect) = 0; |
52 virtual void InspectElementCompleted() = 0; | 54 virtual void InspectElementCompleted() = 0; |
53 virtual void SetIsDocked(bool is_docked) = 0; | 55 virtual void SetIsDocked(bool is_docked) = 0; |
54 virtual void OpenInNewTab(const std::string& url) = 0; | 56 virtual void OpenInNewTab(const std::string& url) = 0; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void IndexingWorked(int request_id, | 193 void IndexingWorked(int request_id, |
192 const std::string& file_system_path, | 194 const std::string& file_system_path, |
193 int worked); | 195 int worked); |
194 void IndexingDone(int request_id, const std::string& file_system_path); | 196 void IndexingDone(int request_id, const std::string& file_system_path); |
195 void SearchCompleted(int request_id, | 197 void SearchCompleted(int request_id, |
196 const std::string& file_system_path, | 198 const std::string& file_system_path, |
197 const std::vector<std::string>& file_paths); | 199 const std::vector<std::string>& file_paths); |
198 typedef base::Callback<void(bool)> InfoBarCallback; | 200 typedef base::Callback<void(bool)> InfoBarCallback; |
199 void ShowDevToolsConfirmInfoBar(const base::string16& message, | 201 void ShowDevToolsConfirmInfoBar(const base::string16& message, |
200 const InfoBarCallback& callback); | 202 const InfoBarCallback& callback); |
| 203 void UpdateFrontendHost(); |
201 | 204 |
202 // Extensions support. | 205 // Extensions support. |
203 void AddDevToolsExtensionsToClient(); | 206 void AddDevToolsExtensionsToClient(); |
204 | 207 |
205 class FrontendWebContentsObserver; | 208 class FrontendWebContentsObserver; |
206 std::unique_ptr<FrontendWebContentsObserver> frontend_contents_observer_; | 209 std::unique_ptr<FrontendWebContentsObserver> frontend_contents_observer_; |
207 | 210 |
208 Profile* profile_; | 211 Profile* profile_; |
209 DevToolsAndroidBridge* android_bridge_; | 212 DevToolsAndroidBridge* android_bridge_; |
210 content::WebContents* web_contents_; | 213 content::WebContents* web_contents_; |
(...skipping 18 matching lines...) Expand all Loading... |
229 embedder_message_dispatcher_; | 232 embedder_message_dispatcher_; |
230 GURL url_; | 233 GURL url_; |
231 using PendingRequestsMap = std::map<const net::URLFetcher*, DispatchCallback>; | 234 using PendingRequestsMap = std::map<const net::URLFetcher*, DispatchCallback>; |
232 PendingRequestsMap pending_requests_; | 235 PendingRequestsMap pending_requests_; |
233 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; | 236 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; |
234 | 237 |
235 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); | 238 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); |
236 }; | 239 }; |
237 | 240 |
238 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ | 241 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ |
OLD | NEW |