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 25 matching lines...) Expand all Loading... |
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); | 45 static GURL SanitizeFrontendURL(const GURL& url); |
| 46 static bool IsValidFrontendURL(const GURL& url); |
46 | 47 |
47 class Delegate { | 48 class Delegate { |
48 public: | 49 public: |
49 virtual ~Delegate() {} | 50 virtual ~Delegate() {} |
50 virtual void ActivateWindow() = 0; | 51 virtual void ActivateWindow() = 0; |
51 virtual void CloseWindow() = 0; | 52 virtual void CloseWindow() = 0; |
52 virtual void Inspect(scoped_refptr<content::DevToolsAgentHost> host) = 0; | 53 virtual void Inspect(scoped_refptr<content::DevToolsAgentHost> host) = 0; |
53 virtual void SetInspectedPageBounds(const gfx::Rect& rect) = 0; | 54 virtual void SetInspectedPageBounds(const gfx::Rect& rect) = 0; |
54 virtual void InspectElementCompleted() = 0; | 55 virtual void InspectElementCompleted() = 0; |
55 virtual void SetIsDocked(bool is_docked) = 0; | 56 virtual void SetIsDocked(bool is_docked) = 0; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 void IndexingWorked(int request_id, | 194 void IndexingWorked(int request_id, |
194 const std::string& file_system_path, | 195 const std::string& file_system_path, |
195 int worked); | 196 int worked); |
196 void IndexingDone(int request_id, const std::string& file_system_path); | 197 void IndexingDone(int request_id, const std::string& file_system_path); |
197 void SearchCompleted(int request_id, | 198 void SearchCompleted(int request_id, |
198 const std::string& file_system_path, | 199 const std::string& file_system_path, |
199 const std::vector<std::string>& file_paths); | 200 const std::vector<std::string>& file_paths); |
200 typedef base::Callback<void(bool)> InfoBarCallback; | 201 typedef base::Callback<void(bool)> InfoBarCallback; |
201 void ShowDevToolsConfirmInfoBar(const base::string16& message, | 202 void ShowDevToolsConfirmInfoBar(const base::string16& message, |
202 const InfoBarCallback& callback); | 203 const InfoBarCallback& callback); |
203 void UpdateFrontendHost(); | 204 void UpdateFrontendHost(const GURL& url); |
204 | 205 |
205 // Extensions support. | 206 // Extensions support. |
206 void AddDevToolsExtensionsToClient(); | 207 void AddDevToolsExtensionsToClient(); |
207 | 208 |
208 class FrontendWebContentsObserver; | 209 class FrontendWebContentsObserver; |
209 std::unique_ptr<FrontendWebContentsObserver> frontend_contents_observer_; | 210 std::unique_ptr<FrontendWebContentsObserver> frontend_contents_observer_; |
210 | 211 |
211 Profile* profile_; | 212 Profile* profile_; |
212 DevToolsAndroidBridge* android_bridge_; | 213 DevToolsAndroidBridge* android_bridge_; |
213 content::WebContents* web_contents_; | 214 content::WebContents* web_contents_; |
(...skipping 18 matching lines...) Expand all Loading... |
232 embedder_message_dispatcher_; | 233 embedder_message_dispatcher_; |
233 GURL url_; | 234 GURL url_; |
234 using PendingRequestsMap = std::map<const net::URLFetcher*, DispatchCallback>; | 235 using PendingRequestsMap = std::map<const net::URLFetcher*, DispatchCallback>; |
235 PendingRequestsMap pending_requests_; | 236 PendingRequestsMap pending_requests_; |
236 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; | 237 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; |
237 | 238 |
238 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); | 239 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); |
239 }; | 240 }; |
240 | 241 |
241 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ | 242 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ |
OLD | NEW |