Chromium Code Reviews| Index: chrome/browser/ui/webui/inspect_ui.h |
| diff --git a/chrome/browser/ui/webui/inspect_ui.h b/chrome/browser/ui/webui/inspect_ui.h |
| index 1ee8dd5c1430d6447223fec4e373355da523d0bd..a47b70b024c1376877d583341a3b09362854cab0 100644 |
| --- a/chrome/browser/ui/webui/inspect_ui.h |
| +++ b/chrome/browser/ui/webui/inspect_ui.h |
| @@ -1,5 +1,5 @@ |
| // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| -// Use of this source code is governed by a BSD-style license that can be |
| +// Use of this source_id code is governed by a BSD-style license that can be |
|
vsevik
2013/11/12 14:24:07
revert
Vladislav Kaznacheev
2013/11/13 16:02:33
Done.
|
| // found in the LICENSE file. |
| #ifndef CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ |
| @@ -10,7 +10,6 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/prefs/pref_change_registrar.h" |
| -#include "chrome/browser/devtools/devtools_adb_bridge.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| #include "content/public/browser/web_ui_controller.h" |
| @@ -18,34 +17,32 @@ |
| namespace base { |
| class Value; |
| +class ListValue; |
| } |
| class Browser; |
| -class DevToolsTargetImpl; |
| +class DevToolsRemoteTargetsUIHandler; |
| +class DevToolsTargetsUIHandler; |
| class InspectUI : public content::WebUIController, |
| - public content::NotificationObserver, |
| - public DevToolsAdbBridge::Listener { |
| + public content::NotificationObserver { |
| public: |
| explicit InspectUI(content::WebUI* web_ui); |
| virtual ~InspectUI(); |
| void InitUI(); |
| - DevToolsTargetImpl* FindTarget(const std::string& type, |
| - const std::string& id); |
| - scoped_refptr<DevToolsAdbBridge::RemoteBrowser> FindRemoteBrowser( |
| - const std::string& id); |
| - scoped_refptr<DevToolsAdbBridge::RemotePackage> FindRemotePackage( |
| - const std::string& id); |
| + void Inspect(const std::string& source_id, const std::string& target_id); |
| + void Activate(const std::string& source_id, const std::string& target_id); |
| + void Close(const std::string& source_id, const std::string& target_id); |
| + void Reload(const std::string& source_id, const std::string& target_id); |
| + void Open(const std::string& source_id, |
| + const std::string& browser_id, |
| + const std::string& url); |
| + void Launch(const std::string& source_id, const std::string& package_id); |
| static void InspectDevices(Browser* browser); |
| private: |
| - class WorkerCreationDestructionListener; |
| - |
| - void PopulateWebContentsTargets(); |
| - void PopulateWorkerTargets(const std::vector<DevToolsTargetImpl*>&); |
| - |
| // content::NotificationObserver overrides. |
| virtual void Observe(int type, |
| const content::NotificationSource& source, |
| @@ -56,10 +53,6 @@ class InspectUI : public content::WebUIController, |
| content::WebUIDataSource* CreateInspectUIHTMLSource(); |
| - // DevToolsAdbBridge::Listener overrides. |
| - virtual void RemoteDevicesChanged( |
| - DevToolsAdbBridge::RemoteDevices* devices) OVERRIDE; |
| - |
| void UpdateDiscoverUsbDevicesEnabled(); |
| void UpdatePortForwardingEnabled(); |
| void UpdatePortForwardingConfig(); |
| @@ -68,7 +61,17 @@ class InspectUI : public content::WebUIController, |
| const base::Value* GetPrefValue(const char* name); |
| - scoped_refptr<WorkerCreationDestructionListener> observer_; |
| + void AddTargetUIHandler( |
| + scoped_ptr<DevToolsTargetsUIHandler> handler); |
| + void AddRemoteTargetUIHandler( |
| + scoped_ptr<DevToolsRemoteTargetsUIHandler> handler); |
| + |
| + DevToolsTargetsUIHandler* FindTargetHandler(const std::string& source_id); |
| + DevToolsRemoteTargetsUIHandler* FindRemoteTargetHandler( |
| + const std::string& source_id); |
| + |
| + void PopulateTargets(const std::string& source_id, |
| + scoped_ptr<base::ListValue> targets); |
| // A scoped container for notification registries. |
| content::NotificationRegistrar notification_registrar_; |
| @@ -76,18 +79,12 @@ class InspectUI : public content::WebUIController, |
| // A scoped container for preference change registries. |
| PrefChangeRegistrar pref_change_registrar_; |
| - typedef std::map<std::string, DevToolsTargetImpl*> TargetMap; |
| - TargetMap render_view_host_targets_; |
| - TargetMap worker_targets_; |
| - TargetMap remote_targets_; |
| - |
| - typedef std::map<std::string, |
| - scoped_refptr<DevToolsAdbBridge::RemoteBrowser> > RemoteBrowsers; |
| - RemoteBrowsers remote_browsers_; |
| + typedef std::map<std::string, DevToolsTargetsUIHandler*> TargetHandlerMap; |
| + TargetHandlerMap target_handlers_; |
| - typedef std::map<std::string, |
| - scoped_refptr<DevToolsAdbBridge::RemotePackage> > RemotePackages; |
| - RemotePackages remote_packages_; |
| + typedef std::map<std::string, DevToolsRemoteTargetsUIHandler*> |
| + RemoteTargetHandlerMap; |
| + RemoteTargetHandlerMap remote_target_handlers_; |
| DISALLOW_COPY_AND_ASSIGN(InspectUI); |
| }; |