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_NETWORK_MESSAGE_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NETWORK_MESSAGE_OBSERVER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_NETWORK_MESSAGE_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NETWORK_MESSAGE_OBSERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "chrome/browser/chromeos/cros/network_library.h" | 13 #include "chrome/browser/chromeos/cros/network_library.h" |
14 #include "chrome/browser/chromeos/notifications/system_notification.h" | 14 #include "chrome/browser/chromeos/notifications/system_notification.h" |
15 | 15 |
16 class Profile; | 16 class Profile; |
17 namespace views { | 17 namespace views { |
18 class WindowDelegate; | 18 class WindowDelegate; |
19 } | 19 } |
20 | 20 |
21 namespace chromeos { | 21 namespace chromeos { |
22 | 22 |
23 // The network message observer displays a system notification for network | 23 // The network message observer displays a system notification for network |
24 // messages. | 24 // messages. |
25 | 25 |
26 class NetworkMessageObserver : public NetworkLibrary::NetworkManagerObserver, | 26 class NetworkMessageObserver : public NetworkLibrary::Observer { |
27 public NetworkLibrary::CellularDataPlanObserver { | |
28 public: | 27 public: |
29 explicit NetworkMessageObserver(Profile* profile); | 28 explicit NetworkMessageObserver(Profile* profile); |
30 virtual ~NetworkMessageObserver(); | 29 virtual ~NetworkMessageObserver(); |
31 | 30 |
32 typedef std::map<std::string, WifiNetwork*> ServicePathWifiMap; | 31 typedef std::map<std::string, WifiNetwork*> ServicePathWifiMap; |
33 typedef std::map<std::string, CellularNetwork*> ServicePathCellularMap; | 32 typedef std::map<std::string, CellularNetwork*> ServicePathCellularMap; |
34 private: | 33 private: |
35 virtual void CreateModalPopup(views::WindowDelegate* view); | 34 virtual void CreateModalPopup(views::WindowDelegate* view); |
36 virtual void MobileSetup(const ListValue* args); | 35 virtual void MobileSetup(const ListValue* args); |
37 | 36 |
38 // NetworkLibrary::NetworkManagerObserver implementation. | 37 // NetworkLibrary::Observer implementation. |
39 virtual void OnNetworkManagerChanged(NetworkLibrary* obj); | 38 virtual void NetworkChanged(NetworkLibrary* obj); |
40 // NetworkLibrary::CellularDataPlanObserver implementation. | 39 virtual void CellularDataPlanChanged(NetworkLibrary* obj); |
41 virtual void OnCellularDataPlanChanged(NetworkLibrary* obj); | |
42 | 40 |
43 bool initialized_; | 41 bool initialized_; |
44 // Wifi networks by service path. | 42 // Wifi networks by service path. |
45 ServicePathWifiMap wifi_networks_; | 43 ServicePathWifiMap wifi_networks_; |
46 // Cellular networks by service path. | 44 // Cellular networks by service path. |
47 ServicePathCellularMap cellular_networks_; | 45 ServicePathCellularMap cellular_networks_; |
48 | 46 |
49 // Current connect celluar service path. | 47 // Current connect celluar service path. |
50 std::string cellular_service_path_; | 48 std::string cellular_service_path_; |
51 // Last cellular data plan data. | 49 // Last cellular data plan data. |
52 CellularDataPlan cellular_data_plan_; | 50 CellularDataPlan cellular_data_plan_; |
53 | 51 |
54 // Notification for connection errors | 52 // Notification for connection errors |
55 SystemNotification notification_connection_error_; | 53 SystemNotification notification_connection_error_; |
56 // Notification for showing low data warning | 54 // Notification for showing low data warning |
57 SystemNotification notification_low_data_; | 55 SystemNotification notification_low_data_; |
58 // Notification for showing no data warning | 56 // Notification for showing no data warning |
59 SystemNotification notification_no_data_; | 57 SystemNotification notification_no_data_; |
60 | 58 |
61 DISALLOW_COPY_AND_ASSIGN(NetworkMessageObserver); | 59 DISALLOW_COPY_AND_ASSIGN(NetworkMessageObserver); |
62 }; | 60 }; |
63 | 61 |
64 } // namespace chromeos | 62 } // namespace chromeos |
65 | 63 |
66 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_MESSAGE_OBSERVER_H_ | 64 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_MESSAGE_OBSERVER_H_ |
| 65 |
OLD | NEW |