| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CHROMEOS_DOM_UI_INTERNET_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DOM_UI_INTERNET_OPTIONS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DOM_UI_INTERNET_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DOM_UI_INTERNET_OPTIONS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/chromeos/cros/network_library.h" | 10 #include "chrome/browser/chromeos/cros/network_library.h" |
| 11 #include "chrome/browser/dom_ui/options/options_ui.h" | 11 #include "chrome/browser/dom_ui/options/options_ui.h" |
| 12 | 12 |
| 13 class SkBitmap; | 13 class SkBitmap; |
| 14 namespace views { | 14 namespace views { |
| 15 class WindowDelegate; | 15 class WindowDelegate; |
| 16 } | 16 } |
| 17 | 17 |
| 18 // ChromeOS internet options page UI handler. | 18 // ChromeOS internet options page UI handler. |
| 19 class InternetOptionsHandler : public OptionsPageUIHandler, | 19 class InternetOptionsHandler |
| 20 public chromeos::NetworkLibrary::Observer { | 20 : public OptionsPageUIHandler, |
| 21 public chromeos::NetworkLibrary::NetworkManagerObserver, |
| 22 public chromeos::NetworkLibrary::NetworkObserver, |
| 23 public chromeos::NetworkLibrary::CellularDataPlanObserver { |
| 21 public: | 24 public: |
| 22 InternetOptionsHandler(); | 25 InternetOptionsHandler(); |
| 23 virtual ~InternetOptionsHandler(); | 26 virtual ~InternetOptionsHandler(); |
| 24 | 27 |
| 25 // OptionsUIHandler implementation. | 28 // OptionsUIHandler implementation. |
| 26 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | 29 virtual void GetLocalizedValues(DictionaryValue* localized_strings); |
| 27 | 30 |
| 28 // DOMMessageHandler implementation. | 31 // DOMMessageHandler implementation. |
| 29 virtual void RegisterMessages(); | 32 virtual void RegisterMessages(); |
| 30 | 33 |
| 31 // NetworkLibrary::Observer implementation. | 34 // NetworkLibrary::NetworkManagerObserver implementation. |
| 32 virtual void NetworkChanged(chromeos::NetworkLibrary* obj); | 35 virtual void OnNetworkManagerChanged(chromeos::NetworkLibrary* network_lib); |
| 33 virtual void CellularDataPlanChanged(chromeos::NetworkLibrary* obj); | 36 // NetworkLibrary::NetworkObserver implementation. |
| 37 virtual void OnNetworkChanged(chromeos::NetworkLibrary* network_lib, |
| 38 const chromeos::Network* network); |
| 39 // NetworkLibrary::CellularDataPlanObserver implementation. |
| 40 virtual void OnCellularDataPlanChanged(chromeos::NetworkLibrary* network_lib); |
| 34 | 41 |
| 35 private: | 42 private: |
| 36 // Passes data needed to show details overlay for network. | 43 // Passes data needed to show details overlay for network. |
| 37 // |args| will be [ network_type, service_path, command ] | 44 // |args| will be [ network_type, service_path, command ] |
| 38 // And command is one of 'options', 'connect', disconnect', or 'forget' | 45 // And command is one of 'options', 'connect', disconnect', or 'forget' |
| 39 void ButtonClickCallback(const ListValue* args); | 46 void ButtonClickCallback(const ListValue* args); |
| 40 // Initiates cellular plan data refresh. The results from libcros will | 47 // Initiates cellular plan data refresh. The results from libcros will |
| 41 // be passed through CellularDataPlanChanged() callback method. | 48 // be passed through CellularDataPlanChanged() callback method. |
| 42 // |args| will be [ service_path ] | 49 // |args| will be [ service_path ] |
| 43 void RefreshCellularPlanCallback(const ListValue* args); | 50 void RefreshCellularPlanCallback(const ListValue* args); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 74 const std::string& name, bool connecting, bool connected, | 81 const std::string& name, bool connecting, bool connected, |
| 75 chromeos::ConnectionType connection_type, bool remembered, | 82 chromeos::ConnectionType connection_type, bool remembered, |
| 76 chromeos::ActivationState activation_state); | 83 chromeos::ActivationState activation_state); |
| 77 | 84 |
| 78 // Creates the map of wired networks | 85 // Creates the map of wired networks |
| 79 ListValue* GetWiredList(); | 86 ListValue* GetWiredList(); |
| 80 // Creates the map of wireless networks | 87 // Creates the map of wireless networks |
| 81 ListValue* GetWirelessList(); | 88 ListValue* GetWirelessList(); |
| 82 // Creates the map of remembered networks | 89 // Creates the map of remembered networks |
| 83 ListValue* GetRememberedList(); | 90 ListValue* GetRememberedList(); |
| 91 // Refresh the display of network information |
| 92 void RefreshNetworkData(chromeos::NetworkLibrary* cros); |
| 93 // Monitor the active network, if any |
| 94 void MonitorActiveNetwork(chromeos::NetworkLibrary* cros); |
| 95 |
| 96 // If any network is currently active, this is its service path |
| 97 std::string active_network_; |
| 84 | 98 |
| 85 DISALLOW_COPY_AND_ASSIGN(InternetOptionsHandler); | 99 DISALLOW_COPY_AND_ASSIGN(InternetOptionsHandler); |
| 86 }; | 100 }; |
| 87 | 101 |
| 88 #endif // CHROME_BROWSER_CHROMEOS_DOM_UI_INTERNET_OPTIONS_HANDLER_H_ | 102 #endif // CHROME_BROWSER_CHROMEOS_DOM_UI_INTERNET_OPTIONS_HANDLER_H_ |
| OLD | NEW |