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 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.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; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 content::WebUIDataSource* CreateInspectUIHTMLSource(); | 60 content::WebUIDataSource* CreateInspectUIHTMLSource(); |
61 | 61 |
62 void UpdateDiscoverUsbDevicesEnabled(); | 62 void UpdateDiscoverUsbDevicesEnabled(); |
63 void UpdatePortForwardingEnabled(); | 63 void UpdatePortForwardingEnabled(); |
64 void UpdatePortForwardingConfig(); | 64 void UpdatePortForwardingConfig(); |
65 | 65 |
66 void SetPortForwardingDefaults(); | 66 void SetPortForwardingDefaults(); |
67 | 67 |
68 const base::Value* GetPrefValue(const char* name); | 68 const base::Value* GetPrefValue(const char* name); |
69 | 69 |
70 void AddTargetUIHandler( | 70 void AddTargetUIHandler(std::unique_ptr<DevToolsTargetsUIHandler> handler); |
71 scoped_ptr<DevToolsTargetsUIHandler> handler); | |
72 | 71 |
73 DevToolsTargetsUIHandler* FindTargetHandler( | 72 DevToolsTargetsUIHandler* FindTargetHandler( |
74 const std::string& source_id); | 73 const std::string& source_id); |
75 DevToolsTargetImpl* FindTarget(const std::string& source_id, | 74 DevToolsTargetImpl* FindTarget(const std::string& source_id, |
76 const std::string& target_id); | 75 const std::string& target_id); |
77 | 76 |
78 void PopulateTargets(const std::string& source_id, | 77 void PopulateTargets(const std::string& source_id, |
79 const base::ListValue& targets); | 78 const base::ListValue& targets); |
80 | 79 |
81 void ForceUpdateIfNeeded(const std::string& source_id, | 80 void ForceUpdateIfNeeded(const std::string& source_id, |
82 const std::string& target_type); | 81 const std::string& target_type); |
83 | 82 |
84 void PopulatePortStatus(const base::Value& status); | 83 void PopulatePortStatus(const base::Value& status); |
85 | 84 |
86 void ShowIncognitoWarning(); | 85 void ShowIncognitoWarning(); |
87 | 86 |
88 // A scoped container for notification registries. | 87 // A scoped container for notification registries. |
89 content::NotificationRegistrar notification_registrar_; | 88 content::NotificationRegistrar notification_registrar_; |
90 | 89 |
91 // A scoped container for preference change registries. | 90 // A scoped container for preference change registries. |
92 PrefChangeRegistrar pref_change_registrar_; | 91 PrefChangeRegistrar pref_change_registrar_; |
93 | 92 |
94 typedef std::map<std::string, DevToolsTargetsUIHandler*> TargetHandlerMap; | 93 typedef std::map<std::string, DevToolsTargetsUIHandler*> TargetHandlerMap; |
95 TargetHandlerMap target_handlers_; | 94 TargetHandlerMap target_handlers_; |
96 | 95 |
97 scoped_ptr<PortForwardingStatusSerializer> port_status_serializer_; | 96 std::unique_ptr<PortForwardingStatusSerializer> port_status_serializer_; |
98 | 97 |
99 DISALLOW_COPY_AND_ASSIGN(InspectUI); | 98 DISALLOW_COPY_AND_ASSIGN(InspectUI); |
100 }; | 99 }; |
101 | 100 |
102 #endif // CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ | 101 #endif // CHROME_BROWSER_UI_WEBUI_INSPECT_UI_H_ |
OLD | NEW |