Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.h

Issue 1006553002: Add third-party VPN support to network details dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_2_460428_add_ash_ui
Patch Set: Addressed comments. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_OPTIONS_CHROMEOS_INTERNET_OPTIONS_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_INTERNET_OPTIONS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_INTERNET_OPTIONS_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_INTERNET_OPTIONS_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/ui/webui/options/options_ui.h" 12 #include "chrome/browser/ui/webui/options/options_ui.h"
13 #include "chromeos/network/network_state_handler_observer.h" 13 #include "chromeos/network/network_state_handler_observer.h"
14 #include "extensions/browser/extension_registry_observer.h"
14 #include "ui/gfx/native_widget_types.h" 15 #include "ui/gfx/native_widget_types.h"
15 16
16 class Browser; 17 class Browser;
17 class PrefService; 18 class PrefService;
18 19
19 namespace chromeos { 20 namespace chromeos {
20 class DeviceState; 21 class DeviceState;
21 class NetworkState; 22 class NetworkState;
22 class NetworkStateHandlerObserver; 23 class NetworkStateHandlerObserver;
23 } 24 }
24 25
25 namespace gfx { 26 namespace gfx {
26 class ImageSkia; 27 class ImageSkia;
27 } 28 }
28 29
29 namespace views { 30 namespace views {
30 class WidgetDelegate; 31 class WidgetDelegate;
31 } 32 }
32 33
33 namespace chromeos { 34 namespace chromeos {
34 namespace options { 35 namespace options {
35 36
36 // ChromeOS internet options page UI handler. 37 // ChromeOS internet options page UI handler.
37 class InternetOptionsHandler 38 class InternetOptionsHandler : public ::options::OptionsPageUIHandler,
38 : public ::options::OptionsPageUIHandler, 39 public chromeos::NetworkStateHandlerObserver,
39 public chromeos::NetworkStateHandlerObserver { 40 public extensions::ExtensionRegistryObserver {
40 public: 41 public:
41 InternetOptionsHandler(); 42 InternetOptionsHandler();
42 ~InternetOptionsHandler() override; 43 ~InternetOptionsHandler() override;
43 44
44 private: 45 private:
45 // OptionsPageUIHandler 46 // OptionsPageUIHandler
46 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; 47 void GetLocalizedValues(base::DictionaryValue* localized_strings) override;
47 void InitializePage() override; 48 void InitializePage() override;
48 49
49 // WebUIMessageHandler (from OptionsPageUIHandler) 50 // WebUIMessageHandler (from OptionsPageUIHandler)
50 void RegisterMessages() override; 51 void RegisterMessages() override;
51 52
53 // ExtensionRegistryObserver
54 void OnExtensionLoaded(content::BrowserContext* browser_context,
55 const extensions::Extension* extension) override;
56 void OnExtensionUnloaded(
57 content::BrowserContext* browser_context,
58 const extensions::Extension* extension,
59 extensions::UnloadedExtensionInfo::Reason reason) override;
60 void OnShutdown(extensions::ExtensionRegistry* registry) override;
61
52 // Callbacks to set network state properties. 62 // Callbacks to set network state properties.
53 void ShowMorePlanInfoCallback(const base::ListValue* args); 63 void ShowMorePlanInfoCallback(const base::ListValue* args);
54 void CarrierStatusCallback(); 64 void CarrierStatusCallback();
55 void SetCarrierCallback(const base::ListValue* args); 65 void SetCarrierCallback(const base::ListValue* args);
56 void SimOperationCallback(const base::ListValue* args); 66 void SimOperationCallback(const base::ListValue* args);
57 67
58 // Sets details_guid_ for event forwarding. 68 // Sets details_guid_ for event forwarding.
59 void SetNetworkGuidCallback(const base::ListValue* args); 69 void SetNetworkGuidCallback(const base::ListValue* args);
60 70
61 // networkingPrvate callbacks 71 // networkingPrvate callbacks
62 void GetManagedPropertiesCallback(const base::ListValue* args); 72 void GetManagedPropertiesCallback(const base::ListValue* args);
63 void StartConnectCallback(const base::ListValue* args); 73 void StartConnectCallback(const base::ListValue* args);
64 void SetPropertiesCallback(const base::ListValue* args); 74 void SetPropertiesCallback(const base::ListValue* args);
65 75
76 // Updates the list of VPN providers enabled in the primary user's profile.
77 void UpdateVPNProviders();
78
66 // Refreshes the display of network information. 79 // Refreshes the display of network information.
67 void RefreshNetworkData(); 80 void RefreshNetworkData();
68 81
69 // Updates the display of network connection information for the details page 82 // Updates the display of network connection information for the details page
70 // if visible. 83 // if visible.
71 void UpdateConnectionData(const std::string& service_path); 84 void UpdateConnectionData(const std::string& service_path);
72 85
73 // Callback for ManagedNetworkConnectionHandler::GetManagedProperties. 86 // Callback for ManagedNetworkConnectionHandler::GetManagedProperties.
74 // Calls the JS callback |js_callback_function| with the result. 87 // Calls the JS callback |js_callback_function| with the result.
75 void GetManagedPropertiesResult(const std::string& js_callback_function, 88 void GetManagedPropertiesResult(const std::string& js_callback_function,
(...skipping 19 matching lines...) Expand all
95 108
96 // Gets the user PrefService associated with the WebUI. 109 // Gets the user PrefService associated with the WebUI.
97 const PrefService* GetPrefs() const; 110 const PrefService* GetPrefs() const;
98 111
99 // Additional callbacks for managing networks. 112 // Additional callbacks for managing networks.
100 void AddConnection(const base::ListValue* args); 113 void AddConnection(const base::ListValue* args);
101 void ConfigureNetwork(const base::ListValue* args); 114 void ConfigureNetwork(const base::ListValue* args);
102 void ActivateNetwork(const base::ListValue* args); 115 void ActivateNetwork(const base::ListValue* args);
103 void RemoveNetwork(const base::ListValue* args); 116 void RemoveNetwork(const base::ListValue* args);
104 117
118 // Requests that a list of VPN providers enabled in the primary user's
119 // profile be sent to JavaScript.
120 void LoadVPNProvidersCallback(const base::ListValue* args);
121
105 // Creates the map of wired networks. 122 // Creates the map of wired networks.
106 base::ListValue* GetWiredList(); 123 base::ListValue* GetWiredList();
107 124
108 // Creates the map of wireless networks. 125 // Creates the map of wireless networks.
109 base::ListValue* GetWirelessList(); 126 base::ListValue* GetWirelessList();
110 127
111 // Creates the map of virtual networks. 128 // Creates the map of virtual networks.
112 base::ListValue* GetVPNList(); 129 base::ListValue* GetVPNList();
113 130
114 // Creates the map of remembered networks. 131 // Creates the map of remembered networks.
(...skipping 10 matching lines...) Expand all
125 // of this object. 142 // of this object.
126 base::WeakPtrFactory<InternetOptionsHandler> weak_factory_; 143 base::WeakPtrFactory<InternetOptionsHandler> weak_factory_;
127 144
128 DISALLOW_COPY_AND_ASSIGN(InternetOptionsHandler); 145 DISALLOW_COPY_AND_ASSIGN(InternetOptionsHandler);
129 }; 146 };
130 147
131 } // namespace options 148 } // namespace options
132 } // namespace chromeos 149 } // namespace chromeos
133 150
134 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_INTERNET_OPTIONS_HANDLER_H_ 151 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_INTERNET_OPTIONS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698