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