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