| 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_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" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 // Retrieves a data url for a resource. | 71 // Retrieves a data url for a resource. |
| 72 std::string GetIconDataUrl(int resource_id) const; | 72 std::string GetIconDataUrl(int resource_id) const; |
| 73 | 73 |
| 74 // Refreshes the display of network information. | 74 // Refreshes the display of network information. |
| 75 void RefreshNetworkData(); | 75 void RefreshNetworkData(); |
| 76 | 76 |
| 77 // Updates the display of network connection information for the details page | 77 // Updates the display of network connection information for the details page |
| 78 // if visible. | 78 // if visible. |
| 79 void UpdateConnectionData(const std::string& service_path); | 79 void UpdateConnectionData(const std::string& service_path); |
| 80 void UpdateConnectionDataCallback( | 80 |
| 81 const std::string& service_path, | 81 // Callback for ManagedNetworkConnectionHandler::GetManagedProperties. |
| 82 const base::DictionaryValue& shill_properties); | 82 // Calls the JS callback |js_callback_function| with the result. |
| 83 void GetManagedPropertiesResult(const std::string& js_callback_function, |
| 84 const std::string& service_path, |
| 85 const base::DictionaryValue& onc_properties); |
| 86 |
| 83 // Called when carrier data has been updated to informs the JS. | 87 // Called when carrier data has been updated to informs the JS. |
| 84 void UpdateCarrier(); | 88 void UpdateCarrier(); |
| 85 | 89 |
| 86 // NetworkStateHandlerObserver | 90 // NetworkStateHandlerObserver |
| 87 virtual void DeviceListChanged() override; | 91 virtual void DeviceListChanged() override; |
| 88 virtual void NetworkListChanged() override; | 92 virtual void NetworkListChanged() override; |
| 89 virtual void NetworkConnectionStateChanged( | 93 virtual void NetworkConnectionStateChanged( |
| 90 const chromeos::NetworkState* network) override; | 94 const chromeos::NetworkState* network) override; |
| 91 virtual void NetworkPropertiesUpdated( | 95 virtual void NetworkPropertiesUpdated( |
| 92 const chromeos::NetworkState* network) override; | 96 const chromeos::NetworkState* network) override; |
| 93 virtual void DevicePropertiesUpdated( | 97 virtual void DevicePropertiesUpdated( |
| 94 const chromeos::DeviceState* device) override; | 98 const chromeos::DeviceState* device) override; |
| 95 | 99 |
| 96 // Updates the logged in user type. | 100 // Updates the logged in user type. |
| 97 void UpdateLoggedInUserType(); | 101 void UpdateLoggedInUserType(); |
| 98 | 102 |
| 99 // Additional callbacks to set network state properties. | 103 // Additional callbacks to set network state properties. |
| 100 void SetServerHostnameCallback(const base::ListValue* args); | 104 void SetServerHostnameCallback(const base::ListValue* args); |
| 101 void SetPreferNetworkCallback(const base::ListValue* args); | 105 void SetPreferNetworkCallback(const base::ListValue* args); |
| 102 void SetAutoConnectCallback(const base::ListValue* args); | 106 void SetAutoConnectCallback(const base::ListValue* args); |
| 103 void SetIPConfigCallback(const base::ListValue* args); | 107 void SetIPConfigCallback(const base::ListValue* args); |
| 104 void SetIPConfigProperties(const base::ListValue* args, | 108 void SetIPConfigProperties(const base::ListValue* args, |
| 105 const std::string& service_path, | 109 const std::string& service_path, |
| 106 const base::DictionaryValue& shill_properties); | 110 const base::DictionaryValue& shill_properties); |
| 107 | 111 |
| 108 // Retrieves the properties for |service_path| and calls sendNetworkDetails | |
| 109 // with the results. | |
| 110 void PopulateDictionaryDetailsCallback( | |
| 111 const std::string& service_path, | |
| 112 const base::DictionaryValue& shill_properties); | |
| 113 | |
| 114 // Gets the native window for hosting dialogs, etc. | 112 // Gets the native window for hosting dialogs, etc. |
| 115 gfx::NativeWindow GetNativeWindow() const; | 113 gfx::NativeWindow GetNativeWindow() const; |
| 116 | 114 |
| 117 // Gets the UI scale factor. | 115 // Gets the UI scale factor. |
| 118 float GetScaleFactor() const; | 116 float GetScaleFactor() const; |
| 119 | 117 |
| 120 // Gets the user PrefService associated with the WebUI. | 118 // Gets the user PrefService associated with the WebUI. |
| 121 const PrefService* GetPrefs() const; | 119 const PrefService* GetPrefs() const; |
| 122 | 120 |
| 123 // Handle various network commands and clicks on a network item | 121 // Additional callbacks for managing networks. |
| 124 // in the network list. | 122 void AddConnection(const base::ListValue* args); |
| 125 // |args| must be { network_type, service_path, command } with 'command' | 123 void ConfigureNetwork(const base::ListValue* args); |
| 126 // one of: [ add, forget, options, connect disconnect, activate ] | 124 void ActivateNetwork(const base::ListValue* args); |
| 127 void NetworkCommandCallback(const base::ListValue* args); | 125 void RemoveNetwork(const base::ListValue* args); |
| 128 | |
| 129 // Helper functions called by NetworkCommandCallback(...) | |
| 130 void AddConnection(const std::string& type); | |
| 131 void SendShowDetailedInfo(const std::string& service_path); | |
| 132 | 126 |
| 133 // Creates the map of wired networks. | 127 // Creates the map of wired networks. |
| 134 base::ListValue* GetWiredList(); | 128 base::ListValue* GetWiredList(); |
| 135 | 129 |
| 136 // Creates the map of wireless networks. | 130 // Creates the map of wireless networks. |
| 137 base::ListValue* GetWirelessList(); | 131 base::ListValue* GetWirelessList(); |
| 138 | 132 |
| 139 // Creates the map of virtual networks. | 133 // Creates the map of virtual networks. |
| 140 base::ListValue* GetVPNList(); | 134 base::ListValue* GetVPNList(); |
| 141 | 135 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 153 // of this object. | 147 // of this object. |
| 154 base::WeakPtrFactory<InternetOptionsHandler> weak_factory_; | 148 base::WeakPtrFactory<InternetOptionsHandler> weak_factory_; |
| 155 | 149 |
| 156 DISALLOW_COPY_AND_ASSIGN(InternetOptionsHandler); | 150 DISALLOW_COPY_AND_ASSIGN(InternetOptionsHandler); |
| 157 }; | 151 }; |
| 158 | 152 |
| 159 } // namespace options | 153 } // namespace options |
| 160 } // namespace chromeos | 154 } // namespace chromeos |
| 161 | 155 |
| 162 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_INTERNET_OPTIONS_HANDLER_H_ | 156 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_INTERNET_OPTIONS_HANDLER_H_ |
| OLD | NEW |