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 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "components/prefs/pref_change_registrar.h" | 14 #include "components/prefs/pref_change_registrar.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 #include "content/public/browser/web_ui_controller.h" | 17 #include "content/public/browser/web_ui_controller.h" |
18 #include "content/public/browser/web_ui_data_source.h" | 18 #include "content/public/browser/web_ui_data_source.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class Value; | 21 class Value; |
22 class ListValue; | 22 class ListValue; |
23 } | 23 } |
24 | 24 |
| 25 namespace content { |
| 26 class DevToolsAgentHost; |
| 27 } |
| 28 |
25 class Browser; | 29 class Browser; |
26 class DevToolsTargetsUIHandler; | 30 class DevToolsTargetsUIHandler; |
27 class DevToolsTargetImpl; | 31 class DevToolsTargetImpl; |
28 class PortForwardingStatusSerializer; | 32 class PortForwardingStatusSerializer; |
29 | 33 |
30 class InspectUI : public content::WebUIController, | 34 class InspectUI : public content::WebUIController, |
31 public content::NotificationObserver { | 35 public content::NotificationObserver { |
32 public: | 36 public: |
33 explicit InspectUI(content::WebUI* web_ui); | 37 explicit InspectUI(content::WebUI* web_ui); |
34 ~InspectUI() override; | 38 ~InspectUI() override; |
(...skipping 29 matching lines...) Expand all Loading... |
64 void UpdatePortForwardingConfig(); | 68 void UpdatePortForwardingConfig(); |
65 | 69 |
66 void SetPortForwardingDefaults(); | 70 void SetPortForwardingDefaults(); |
67 | 71 |
68 const base::Value* GetPrefValue(const char* name); | 72 const base::Value* GetPrefValue(const char* name); |
69 | 73 |
70 void AddTargetUIHandler(std::unique_ptr<DevToolsTargetsUIHandler> handler); | 74 void AddTargetUIHandler(std::unique_ptr<DevToolsTargetsUIHandler> handler); |
71 | 75 |
72 DevToolsTargetsUIHandler* FindTargetHandler( | 76 DevToolsTargetsUIHandler* FindTargetHandler( |
73 const std::string& source_id); | 77 const std::string& source_id); |
74 DevToolsTargetImpl* FindTarget(const std::string& source_id, | 78 scoped_refptr<content::DevToolsAgentHost> FindTarget( |
75 const std::string& target_id); | 79 const std::string& source_id, |
| 80 const std::string& target_id); |
76 | 81 |
77 void PopulateTargets(const std::string& source_id, | 82 void PopulateTargets(const std::string& source_id, |
78 const base::ListValue& targets); | 83 const base::ListValue& targets); |
79 | 84 |
80 void ForceUpdateIfNeeded(const std::string& source_id, | 85 void ForceUpdateIfNeeded(const std::string& source_id, |
81 const std::string& target_type); | 86 const std::string& target_type); |
82 | 87 |
83 void PopulatePortStatus(const base::Value& status); | 88 void PopulatePortStatus(const base::Value& status); |
84 | 89 |
85 void ShowIncognitoWarning(); | 90 void ShowIncognitoWarning(); |
86 | 91 |
87 // A scoped container for notification registries. | 92 // A scoped container for notification registries. |
88 content::NotificationRegistrar notification_registrar_; | 93 content::NotificationRegistrar notification_registrar_; |
89 | 94 |
90 // A scoped container for preference change registries. | 95 // A scoped container for preference change registries. |
91 PrefChangeRegistrar pref_change_registrar_; | 96 PrefChangeRegistrar pref_change_registrar_; |
92 | 97 |
93 typedef std::map<std::string, DevToolsTargetsUIHandler*> TargetHandlerMap; | 98 typedef std::map<std::string, DevToolsTargetsUIHandler*> TargetHandlerMap; |
94 TargetHandlerMap target_handlers_; | 99 TargetHandlerMap target_handlers_; |
95 | 100 |
96 std::unique_ptr<PortForwardingStatusSerializer> port_status_serializer_; | 101 std::unique_ptr<PortForwardingStatusSerializer> port_status_serializer_; |
97 | 102 |
98 DISALLOW_COPY_AND_ASSIGN(InspectUI); | 103 DISALLOW_COPY_AND_ASSIGN(InspectUI); |
99 }; | 104 }; |
100 | 105 |
101 #endif // CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ | 106 #endif // CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ |
OLD | NEW |