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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 virtual void StopIndexing(int request_id) OVERRIDE; | 109 virtual void StopIndexing(int request_id) OVERRIDE; |
110 virtual void SearchInPath(int request_id, | 110 virtual void SearchInPath(int request_id, |
111 const std::string& file_system_path, | 111 const std::string& file_system_path, |
112 const std::string& query) OVERRIDE; | 112 const std::string& query) OVERRIDE; |
113 virtual void SetWhitelistedShortcuts(const std::string& message) OVERRIDE; | 113 virtual void SetWhitelistedShortcuts(const std::string& message) OVERRIDE; |
114 virtual void ZoomIn() OVERRIDE; | 114 virtual void ZoomIn() OVERRIDE; |
115 virtual void ZoomOut() OVERRIDE; | 115 virtual void ZoomOut() OVERRIDE; |
116 virtual void ResetZoom() OVERRIDE; | 116 virtual void ResetZoom() OVERRIDE; |
117 virtual void OpenUrlOnRemoteDeviceAndInspect(const std::string& browser_id, | 117 virtual void OpenUrlOnRemoteDeviceAndInspect(const std::string& browser_id, |
118 const std::string& url) OVERRIDE; | 118 const std::string& url) OVERRIDE; |
119 virtual void Subscribe(const std::string& event_type) OVERRIDE; | 119 virtual void SetDeviceCountUpdatesEnabled(bool enabled) OVERRIDE; |
120 virtual void Unsubscribe(const std::string& event_type) OVERRIDE; | 120 virtual void SetDevicesUpdatesEnabled(bool enabled) OVERRIDE; |
121 | 121 |
122 void EnableRemoteDeviceCounter(bool enable); | 122 void EnableRemoteDeviceCounter(bool enable); |
123 | 123 |
124 // DevToolsAndroidBridge::DeviceCountListener override: | 124 // DevToolsAndroidBridge::DeviceCountListener override: |
125 virtual void DeviceCountChanged(int count) OVERRIDE; | 125 virtual void DeviceCountChanged(int count) OVERRIDE; |
126 | 126 |
127 // Forwards discovered devices to frontend. | 127 // Forwards discovered devices to frontend. |
128 virtual void PopulateRemoteDevices(const std::string& source, | 128 virtual void DevicesUpdated(const std::string& source, |
129 const base::ListValue& targets); | 129 const base::ListValue& targets); |
130 | 130 |
131 void DocumentOnLoadCompletedInMainFrame(); | 131 void DocumentOnLoadCompletedInMainFrame(); |
132 | 132 |
133 // DevToolsFileHelper callbacks. | 133 // DevToolsFileHelper callbacks. |
134 void FileSavedAs(const std::string& url); | 134 void FileSavedAs(const std::string& url); |
135 void CanceledFileSaveAs(const std::string& url); | 135 void CanceledFileSaveAs(const std::string& url); |
136 void AppendedTo(const std::string& url); | 136 void AppendedTo(const std::string& url); |
137 void FileSystemsLoaded( | 137 void FileSystemsLoaded( |
138 const std::vector<DevToolsFileHelper::FileSystem>& file_systems); | 138 const std::vector<DevToolsFileHelper::FileSystem>& file_systems); |
139 void FileSystemAdded(const DevToolsFileHelper::FileSystem& file_system); | 139 void FileSystemAdded(const DevToolsFileHelper::FileSystem& file_system); |
140 void IndexingTotalWorkCalculated(int request_id, | 140 void IndexingTotalWorkCalculated(int request_id, |
141 const std::string& file_system_path, | 141 const std::string& file_system_path, |
142 int total_work); | 142 int total_work); |
143 void IndexingWorked(int request_id, | 143 void IndexingWorked(int request_id, |
144 const std::string& file_system_path, | 144 const std::string& file_system_path, |
145 int worked); | 145 int worked); |
146 void IndexingDone(int request_id, const std::string& file_system_path); | 146 void IndexingDone(int request_id, const std::string& file_system_path); |
147 void SearchCompleted(int request_id, | 147 void SearchCompleted(int request_id, |
148 const std::string& file_system_path, | 148 const std::string& file_system_path, |
149 const std::vector<std::string>& file_paths); | 149 const std::vector<std::string>& file_paths); |
150 typedef base::Callback<void(bool)> InfoBarCallback; | 150 typedef base::Callback<void(bool)> InfoBarCallback; |
151 void ShowDevToolsConfirmInfoBar(const base::string16& message, | 151 void ShowDevToolsConfirmInfoBar(const base::string16& message, |
152 const InfoBarCallback& callback); | 152 const InfoBarCallback& callback); |
153 | 153 |
154 // Theme and extensions support. | 154 // Theme and extensions support. |
155 void UpdateTheme(); | 155 void UpdateTheme(); |
156 void AddDevToolsExtensionsToClient(); | 156 void AddDevToolsExtensionsToClient(); |
157 | 157 |
158 void DispatchEventOnFrontend(const std::string& event_type, | |
159 const base::Value& event_data); | |
160 | |
161 class FrontendWebContentsObserver; | 158 class FrontendWebContentsObserver; |
162 friend class FrontendWebContentsObserver; | 159 friend class FrontendWebContentsObserver; |
163 scoped_ptr<FrontendWebContentsObserver> frontend_contents_observer_; | 160 scoped_ptr<FrontendWebContentsObserver> frontend_contents_observer_; |
164 | 161 |
165 Profile* profile_; | 162 Profile* profile_; |
166 content::WebContents* web_contents_; | 163 content::WebContents* web_contents_; |
167 scoped_ptr<Delegate> delegate_; | 164 scoped_ptr<Delegate> delegate_; |
168 bool device_listener_enabled_; | |
169 content::NotificationRegistrar registrar_; | 165 content::NotificationRegistrar registrar_; |
170 scoped_ptr<content::DevToolsClientHost> frontend_host_; | 166 scoped_ptr<content::DevToolsClientHost> frontend_host_; |
171 scoped_ptr<DevToolsFileHelper> file_helper_; | 167 scoped_ptr<DevToolsFileHelper> file_helper_; |
172 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_; | 168 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_; |
173 typedef std::map< | 169 typedef std::map< |
174 int, | 170 int, |
175 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > | 171 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > |
176 IndexingJobsMap; | 172 IndexingJobsMap; |
177 IndexingJobsMap indexing_jobs_; | 173 IndexingJobsMap indexing_jobs_; |
178 | 174 |
179 typedef std::set<std::string> Subscribers; | 175 bool device_count_updates_enabled_; |
180 Subscribers subscribers_; | 176 bool devices_updates_enabled_; |
181 scoped_ptr<DevToolsTargetsUIHandler> remote_targets_handler_; | 177 scoped_ptr<DevToolsTargetsUIHandler> remote_targets_handler_; |
182 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; | 178 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; |
183 GURL url_; | 179 GURL url_; |
184 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; | 180 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; |
185 | 181 |
186 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); | 182 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); |
187 }; | 183 }; |
188 | 184 |
189 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ | 185 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ |
OLD | NEW |