| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_WEBUI_INSPECT_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/prefs/pref_change_registrar.h" | 12 #include "base/prefs/pref_change_registrar.h" |
| 13 #include "chrome/browser/devtools/devtools_adb_bridge.h" | 13 #include "chrome/browser/devtools/devtools_adb_bridge.h" |
| 14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
| 15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
| 16 #include "content/public/browser/web_ui_controller.h" | 16 #include "content/public/browser/web_ui_controller.h" |
| 17 #include "content/public/browser/web_ui_data_source.h" | 17 #include "content/public/browser/web_ui_data_source.h" |
| 18 | 18 |
| 19 class InspectUI : public content::WebUIController, | 19 class InspectUI : public content::WebUIController, |
| 20 public content::NotificationObserver, | 20 public content::NotificationObserver, |
| 21 public DevToolsAdbBridge::Listener { | 21 public DevToolsAdbBridge::Listener { |
| 22 public: | 22 public: |
| 23 explicit InspectUI(content::WebUI* web_ui); | 23 explicit InspectUI(content::WebUI* web_ui); |
| 24 virtual ~InspectUI(); | 24 virtual ~InspectUI(); |
| 25 | 25 |
| 26 void InitUI(); | 26 void InitUI(); |
| 27 void InspectRemotePage(const std::string& id); | 27 void InspectRemotePage(const std::string& page_id); |
| 28 void CloseRemotePage(const std::string& page_id); |
| 29 void ReloadRemotePage(const std::string& page_id); |
| 30 void OpenRemotePage(const std::string& browser_id, const std::string& url); |
| 28 | 31 |
| 29 private: | 32 private: |
| 30 class WorkerCreationDestructionListener; | 33 class WorkerCreationDestructionListener; |
| 31 | 34 |
| 32 void PopulateLists(); | 35 void PopulateLists(); |
| 33 | 36 |
| 34 // content::NotificationObserver overrides. | 37 // content::NotificationObserver overrides. |
| 35 virtual void Observe(int type, | 38 virtual void Observe(int type, |
| 36 const content::NotificationSource& source, | 39 const content::NotificationSource& source, |
| 37 const content::NotificationDetails& details) OVERRIDE; | 40 const content::NotificationDetails& details) OVERRIDE; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 53 // A scoped container for notification registries. | 56 // A scoped container for notification registries. |
| 54 content::NotificationRegistrar notification_registrar_; | 57 content::NotificationRegistrar notification_registrar_; |
| 55 | 58 |
| 56 // A scoped container for preference change registries. | 59 // A scoped container for preference change registries. |
| 57 PrefChangeRegistrar pref_change_registrar_; | 60 PrefChangeRegistrar pref_change_registrar_; |
| 58 | 61 |
| 59 typedef std::map<std::string, scoped_refptr<DevToolsAdbBridge::RemotePage> > | 62 typedef std::map<std::string, scoped_refptr<DevToolsAdbBridge::RemotePage> > |
| 60 RemotePages; | 63 RemotePages; |
| 61 RemotePages remote_pages_; | 64 RemotePages remote_pages_; |
| 62 | 65 |
| 66 typedef std::map<std::string, |
| 67 scoped_refptr<DevToolsAdbBridge::RemoteBrowser> > RemoteBrowsers; |
| 68 RemoteBrowsers remote_browsers_; |
| 69 |
| 63 DISALLOW_COPY_AND_ASSIGN(InspectUI); | 70 DISALLOW_COPY_AND_ASSIGN(InspectUI); |
| 64 }; | 71 }; |
| 65 | 72 |
| 66 #endif // CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ | 73 #endif // CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ |
| OLD | NEW |