| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::DevToolsClientHost* frontend_host() { return frontend_host_.get(); } | 68 content::DevToolsClientHost* frontend_host() { return frontend_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 DispatchEventOnFrontend(const std::string& event_type, | |
| 77 const base::Value* event_data); | |
| 78 private: | 76 private: |
| 79 // content::NotificationObserver: | 77 // content::NotificationObserver: |
| 80 virtual void Observe(int type, | 78 virtual void Observe(int type, |
| 81 const content::NotificationSource& source, | 79 const content::NotificationSource& source, |
| 82 const content::NotificationDetails& details) OVERRIDE; | 80 const content::NotificationDetails& details) OVERRIDE; |
| 83 | 81 |
| 84 // content::DevToolsFrontendHostDelegate override: | 82 // content::DevToolsFrontendHostDelegate override: |
| 85 virtual void InspectedContentsClosing() OVERRIDE; | 83 virtual void InspectedContentsClosing() OVERRIDE; |
| 86 virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE; | 84 virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE; |
| 87 | 85 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 virtual void Subscribe(const std::string& event_type) OVERRIDE; | 119 virtual void Subscribe(const std::string& event_type) OVERRIDE; |
| 122 virtual void Unsubscribe(const std::string& event_type) OVERRIDE; | 120 virtual void Unsubscribe(const std::string& event_type) OVERRIDE; |
| 123 | 121 |
| 124 void EnableRemoteDeviceCounter(bool enable); | 122 void EnableRemoteDeviceCounter(bool enable); |
| 125 | 123 |
| 126 // DevToolsAndroidBridge::DeviceCountListener override: | 124 // DevToolsAndroidBridge::DeviceCountListener override: |
| 127 virtual void DeviceCountChanged(int count) OVERRIDE; | 125 virtual void DeviceCountChanged(int count) OVERRIDE; |
| 128 | 126 |
| 129 // Forwards discovered devices to frontend. | 127 // Forwards discovered devices to frontend. |
| 130 virtual void PopulateRemoteDevices(const std::string& source, | 128 virtual void PopulateRemoteDevices(const std::string& source, |
| 131 scoped_ptr<base::ListValue> targets); | 129 const base::ListValue& targets); |
| 132 | 130 |
| 133 void DocumentOnLoadCompletedInMainFrame(); | 131 void DocumentOnLoadCompletedInMainFrame(); |
| 134 | 132 |
| 135 // DevToolsFileHelper callbacks. | 133 // DevToolsFileHelper callbacks. |
| 136 void FileSavedAs(const std::string& url); | 134 void FileSavedAs(const std::string& url); |
| 137 void CanceledFileSaveAs(const std::string& url); | 135 void CanceledFileSaveAs(const std::string& url); |
| 138 void AppendedTo(const std::string& url); | 136 void AppendedTo(const std::string& url); |
| 139 void FileSystemsLoaded( | 137 void FileSystemsLoaded( |
| 140 const std::vector<DevToolsFileHelper::FileSystem>& file_systems); | 138 const std::vector<DevToolsFileHelper::FileSystem>& file_systems); |
| 141 void FileSystemAdded(const DevToolsFileHelper::FileSystem& file_system); | 139 void FileSystemAdded(const DevToolsFileHelper::FileSystem& file_system); |
| 142 void IndexingTotalWorkCalculated(int request_id, | 140 void IndexingTotalWorkCalculated(int request_id, |
| 143 const std::string& file_system_path, | 141 const std::string& file_system_path, |
| 144 int total_work); | 142 int total_work); |
| 145 void IndexingWorked(int request_id, | 143 void IndexingWorked(int request_id, |
| 146 const std::string& file_system_path, | 144 const std::string& file_system_path, |
| 147 int worked); | 145 int worked); |
| 148 void IndexingDone(int request_id, const std::string& file_system_path); | 146 void IndexingDone(int request_id, const std::string& file_system_path); |
| 149 void SearchCompleted(int request_id, | 147 void SearchCompleted(int request_id, |
| 150 const std::string& file_system_path, | 148 const std::string& file_system_path, |
| 151 const std::vector<std::string>& file_paths); | 149 const std::vector<std::string>& file_paths); |
| 152 typedef base::Callback<void(bool)> InfoBarCallback; | 150 typedef base::Callback<void(bool)> InfoBarCallback; |
| 153 void ShowDevToolsConfirmInfoBar(const base::string16& message, | 151 void ShowDevToolsConfirmInfoBar(const base::string16& message, |
| 154 const InfoBarCallback& callback); | 152 const InfoBarCallback& callback); |
| 155 | 153 |
| 156 // Theme and extensions support. | 154 // Theme and extensions support. |
| 157 void UpdateTheme(); | 155 void UpdateTheme(); |
| 158 void AddDevToolsExtensionsToClient(); | 156 void AddDevToolsExtensionsToClient(); |
| 159 | 157 |
| 158 void DispatchEventOnFrontend(const std::string& event_type, |
| 159 const base::Value& event_data); |
| 160 |
| 160 class FrontendWebContentsObserver; | 161 class FrontendWebContentsObserver; |
| 161 friend class FrontendWebContentsObserver; | 162 friend class FrontendWebContentsObserver; |
| 162 scoped_ptr<FrontendWebContentsObserver> frontend_contents_observer_; | 163 scoped_ptr<FrontendWebContentsObserver> frontend_contents_observer_; |
| 163 | 164 |
| 164 Profile* profile_; | 165 Profile* profile_; |
| 165 content::WebContents* web_contents_; | 166 content::WebContents* web_contents_; |
| 166 scoped_ptr<Delegate> delegate_; | 167 scoped_ptr<Delegate> delegate_; |
| 167 bool device_listener_enabled_; | 168 bool device_listener_enabled_; |
| 168 content::NotificationRegistrar registrar_; | 169 content::NotificationRegistrar registrar_; |
| 169 scoped_ptr<content::DevToolsClientHost> frontend_host_; | 170 scoped_ptr<content::DevToolsClientHost> frontend_host_; |
| 170 scoped_ptr<DevToolsFileHelper> file_helper_; | 171 scoped_ptr<DevToolsFileHelper> file_helper_; |
| 171 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_; | 172 scoped_refptr<DevToolsFileSystemIndexer> file_system_indexer_; |
| 172 typedef std::map< | 173 typedef std::map< |
| 173 int, | 174 int, |
| 174 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > | 175 scoped_refptr<DevToolsFileSystemIndexer::FileSystemIndexingJob> > |
| 175 IndexingJobsMap; | 176 IndexingJobsMap; |
| 176 IndexingJobsMap indexing_jobs_; | 177 IndexingJobsMap indexing_jobs_; |
| 177 | 178 |
| 178 typedef std::set<std::string> Subscribers; | 179 typedef std::set<std::string> Subscribers; |
| 179 Subscribers subscribers_; | 180 Subscribers subscribers_; |
| 180 scoped_ptr<DevToolsTargetsUIHandler> remote_targets_handler_; | 181 scoped_ptr<DevToolsTargetsUIHandler> remote_targets_handler_; |
| 181 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; | 182 scoped_ptr<DevToolsEmbedderMessageDispatcher> embedder_message_dispatcher_; |
| 182 GURL url_; | 183 GURL url_; |
| 183 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; | 184 base::WeakPtrFactory<DevToolsUIBindings> weak_factory_; |
| 184 | 185 |
| 185 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); | 186 DISALLOW_COPY_AND_ASSIGN(DevToolsUIBindings); |
| 186 }; | 187 }; |
| 187 | 188 |
| 188 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ | 189 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_UI_BINDINGS_H_ |
| OLD | NEW |