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