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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 virtual void OpenInNewTab(const std::string& url) = 0; | 54 virtual void OpenInNewTab(const std::string& url) = 0; |
55 virtual void SetWhitelistedShortcuts(const std::string& message) = 0; | 55 virtual void SetWhitelistedShortcuts(const std::string& message) = 0; |
56 | 56 |
57 virtual void InspectedContentsClosing() = 0; | 57 virtual void InspectedContentsClosing() = 0; |
58 virtual void OnLoadCompleted() = 0; | 58 virtual void OnLoadCompleted() = 0; |
59 virtual InfoBarService* GetInfoBarService() = 0; | 59 virtual InfoBarService* GetInfoBarService() = 0; |
60 virtual void RenderProcessGone() = 0; | 60 virtual void RenderProcessGone() = 0; |
61 }; | 61 }; |
62 | 62 |
63 explicit DevToolsUIBindings(content::WebContents* web_contents); | 63 explicit DevToolsUIBindings(content::WebContents* web_contents); |
64 virtual ~DevToolsUIBindings(); | 64 ~DevToolsUIBindings() override; |
65 | 65 |
66 content::WebContents* web_contents() { return web_contents_; } | 66 content::WebContents* web_contents() { return web_contents_; } |
67 Profile* profile() { return profile_; } | 67 Profile* profile() { return profile_; } |
68 content::DevToolsAgentHost* agent_host() { return agent_host_.get(); } | 68 content::DevToolsAgentHost* agent_host() { return agent_host_.get(); } |
69 | 69 |
70 // Takes ownership over the |delegate|. | 70 // Takes ownership over the |delegate|. |
71 void SetDelegate(Delegate* delegate); | 71 void SetDelegate(Delegate* delegate); |
72 void CallClientFunction(const std::string& function_name, | 72 void CallClientFunction(const std::string& function_name, |
73 const base::Value* arg1, | 73 const base::Value* arg1, |
74 const base::Value* arg2, | 74 const base::Value* arg2, |
75 const base::Value* arg3); | 75 const base::Value* arg3); |
76 void AttachTo(const scoped_refptr<content::DevToolsAgentHost>& agent_host); | 76 void AttachTo(const scoped_refptr<content::DevToolsAgentHost>& agent_host); |
77 void Reattach(); | 77 void Reattach(); |
78 void Detach(); | 78 void Detach(); |
79 bool IsAttachedTo(content::DevToolsAgentHost* agent_host); | 79 bool IsAttachedTo(content::DevToolsAgentHost* agent_host); |
80 | 80 |
81 private: | 81 private: |
82 // content::NotificationObserver overrides. | 82 // content::NotificationObserver overrides. |
83 virtual void Observe(int type, | 83 void Observe(int type, |
84 const content::NotificationSource& source, | 84 const content::NotificationSource& source, |
85 const content::NotificationDetails& details) override; | 85 const content::NotificationDetails& details) override; |
86 | 86 |
87 // content::DevToolsFrontendHost::Delegate implementation. | 87 // content::DevToolsFrontendHost::Delegate implementation. |
88 virtual void HandleMessageFromDevToolsFrontend( | 88 void HandleMessageFromDevToolsFrontend(const std::string& message) override; |
89 const std::string& message) override; | 89 void HandleMessageFromDevToolsFrontendToBackend( |
90 virtual void HandleMessageFromDevToolsFrontendToBackend( | |
91 const std::string& message) override; | 90 const std::string& message) override; |
92 | 91 |
93 // content::DevToolsAgentHostClient implementation. | 92 // content::DevToolsAgentHostClient implementation. |
94 virtual void DispatchProtocolMessage( | 93 void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, |
95 content::DevToolsAgentHost* agent_host, | 94 const std::string& message) override; |
96 const std::string& message) override; | 95 void AgentHostClosed(content::DevToolsAgentHost* agent_host, |
97 virtual void AgentHostClosed( | 96 bool replaced_with_another_client) override; |
98 content::DevToolsAgentHost* agent_host, | |
99 bool replaced_with_another_client) override; | |
100 | 97 |
101 // DevToolsEmbedderMessageDispatcher::Delegate implementation. | 98 // DevToolsEmbedderMessageDispatcher::Delegate implementation. |
102 virtual void ActivateWindow() override; | 99 void ActivateWindow() override; |
103 virtual void CloseWindow() override; | 100 void CloseWindow() override; |
104 virtual void LoadCompleted() override; | 101 void LoadCompleted() override; |
105 virtual void SetInspectedPageBounds(const gfx::Rect& rect) override; | 102 void SetInspectedPageBounds(const gfx::Rect& rect) override; |
106 virtual void InspectElementCompleted() override; | 103 void InspectElementCompleted() override; |
107 virtual void InspectedURLChanged(const std::string& url) override; | 104 void InspectedURLChanged(const std::string& url) override; |
108 virtual void MoveWindow(int x, int y) override; | 105 void MoveWindow(int x, int y) override; |
109 virtual void SetIsDocked(bool is_docked) override; | 106 void SetIsDocked(bool is_docked) override; |
110 virtual void OpenInNewTab(const std::string& url) override; | 107 void OpenInNewTab(const std::string& url) override; |
111 virtual void SaveToFile(const std::string& url, | 108 void SaveToFile(const std::string& url, |
112 const std::string& content, | 109 const std::string& content, |
113 bool save_as) override; | 110 bool save_as) override; |
114 virtual void AppendToFile(const std::string& url, | 111 void AppendToFile(const std::string& url, |
115 const std::string& content) override; | 112 const std::string& content) override; |
116 virtual void RequestFileSystems() override; | 113 void RequestFileSystems() override; |
117 virtual void AddFileSystem() override; | 114 void AddFileSystem() override; |
118 virtual void RemoveFileSystem(const std::string& file_system_path) override; | 115 void RemoveFileSystem(const std::string& file_system_path) override; |
119 virtual void UpgradeDraggedFileSystemPermissions( | 116 void UpgradeDraggedFileSystemPermissions( |
120 const std::string& file_system_url) override; | 117 const std::string& file_system_url) override; |
121 virtual void IndexPath(int request_id, | 118 void IndexPath(int request_id, const std::string& file_system_path) override; |
122 const std::string& file_system_path) override; | 119 void StopIndexing(int request_id) override; |
123 virtual void StopIndexing(int request_id) override; | 120 void SearchInPath(int request_id, |
124 virtual void SearchInPath(int request_id, | 121 const std::string& file_system_path, |
125 const std::string& file_system_path, | 122 const std::string& query) override; |
126 const std::string& query) override; | 123 void SetWhitelistedShortcuts(const std::string& message) override; |
127 virtual void SetWhitelistedShortcuts(const std::string& message) override; | 124 void ZoomIn() override; |
128 virtual void ZoomIn() override; | 125 void ZoomOut() override; |
129 virtual void ZoomOut() override; | 126 void ResetZoom() override; |
130 virtual void ResetZoom() override; | 127 void OpenUrlOnRemoteDeviceAndInspect(const std::string& browser_id, |
131 virtual void OpenUrlOnRemoteDeviceAndInspect(const std::string& browser_id, | 128 const std::string& url) override; |
132 const std::string& url) override; | 129 void SetDeviceCountUpdatesEnabled(bool enabled) override; |
133 virtual void SetDeviceCountUpdatesEnabled(bool enabled) override; | 130 void SetDevicesUpdatesEnabled(bool enabled) override; |
134 virtual void SetDevicesUpdatesEnabled(bool enabled) override; | 131 void SendMessageToBrowser(const std::string& message) override; |
135 virtual void SendMessageToBrowser(const std::string& message) override; | |
136 | 132 |
137 void EnableRemoteDeviceCounter(bool enable); | 133 void EnableRemoteDeviceCounter(bool enable); |
138 | 134 |
139 // DevToolsAndroidBridge::DeviceCountListener override: | 135 // DevToolsAndroidBridge::DeviceCountListener override: |
140 virtual void DeviceCountChanged(int count) override; | 136 void DeviceCountChanged(int count) override; |
141 | 137 |
142 // Forwards discovered devices to frontend. | 138 // Forwards discovered devices to frontend. |
143 virtual void DevicesUpdated(const std::string& source, | 139 virtual void DevicesUpdated(const std::string& source, |
144 const base::ListValue& targets); | 140 const base::ListValue& targets); |
145 | 141 |
146 void DocumentOnLoadCompletedInMainFrame(); | 142 void DocumentOnLoadCompletedInMainFrame(); |
147 void DidNavigateMainFrame(); | 143 void DidNavigateMainFrame(); |
148 void FrontendLoaded(); | 144 void FrontendLoaded(); |
149 | 145 |
150 // DevToolsFileHelper callbacks. | 146 // DevToolsFileHelper callbacks. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 bool frontend_loaded_; | 191 bool frontend_loaded_; |
196 scoped_ptr<DevToolsTargetsUIHandler> remote_targets_handler_; | 192 scoped_ptr<DevToolsTargetsUIHandler> remote_targets_handler_; |
197 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; | 193 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; |
198 GURL url_; | 194 GURL url_; |
199 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; | 195 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; |
200 | 196 |
201 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); | 197 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); |
202 }; | 198 }; |
203 | 199 |
204 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ | 200 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ |
OLD | NEW |