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 { | |
18 class WindowDelegate; | |
19 } | |
20 | 17 |
21 namespace chromeos { | 18 namespace chromeos { |
22 | 19 |
23 // The network message observer displays a system notification for network | 20 // The network message observer displays a system notification for network |
24 // messages. | 21 // messages. |
25 | 22 |
26 class NetworkMessageObserver : public NetworkLibrary::NetworkManagerObserver, | 23 class NetworkMessageObserver : public NetworkLibrary::NetworkManagerObserver, |
27 public NetworkLibrary::CellularDataPlanObserver { | 24 public NetworkLibrary::CellularDataPlanObserver { |
28 public: | 25 public: |
29 explicit NetworkMessageObserver(Profile* profile); | 26 explicit NetworkMessageObserver(Profile* profile); |
30 virtual ~NetworkMessageObserver(); | 27 virtual ~NetworkMessageObserver(); |
31 | 28 |
32 typedef std::map<std::string, WifiNetwork*> ServicePathWifiMap; | 29 typedef std::map<std::string, WifiNetwork*> ServicePathWifiMap; |
33 typedef std::map<std::string, CellularNetwork*> ServicePathCellularMap; | 30 typedef std::map<std::string, CellularNetwork*> ServicePathCellularMap; |
34 private: | 31 private: |
35 virtual void CreateModalPopup(views::WindowDelegate* view); | |
36 virtual void OpenMobileSetupPage(const ListValue* args); | 32 virtual void OpenMobileSetupPage(const ListValue* args); |
37 virtual void OpenMoreInfoPage(const ListValue* args); | 33 virtual void OpenMoreInfoPage(const ListValue* args); |
38 | 34 |
39 // NetworkLibrary::NetworkManagerObserver implementation. | 35 // NetworkLibrary::NetworkManagerObserver implementation. |
40 virtual void OnNetworkManagerChanged(NetworkLibrary* obj); | 36 virtual void OnNetworkManagerChanged(NetworkLibrary* obj); |
41 // NetworkLibrary::CellularDataPlanObserver implementation. | 37 // NetworkLibrary::CellularDataPlanObserver implementation. |
42 virtual void OnCellularDataPlanChanged(NetworkLibrary* obj); | 38 virtual void OnCellularDataPlanChanged(NetworkLibrary* obj); |
43 | 39 |
44 bool initialized_; | |
45 // Wifi networks by service path. | 40 // Wifi networks by service path. |
46 ServicePathWifiMap wifi_networks_; | 41 ServicePathWifiMap wifi_networks_; |
47 // Cellular networks by service path. | 42 // Cellular networks by service path. |
48 ServicePathCellularMap cellular_networks_; | 43 ServicePathCellularMap cellular_networks_; |
49 | 44 |
50 // Current connect celluar service path. | 45 // Current connect celluar service path. |
51 std::string cellular_service_path_; | 46 std::string cellular_service_path_; |
52 // Last cellular data plan name and type. | 47 // Last cellular data plan name and type. |
53 std::string cellular_data_plan_name_; | 48 std::string cellular_data_plan_name_; |
54 CellularDataPlanType cellular_data_plan_type_; | 49 CellularDataPlanType cellular_data_plan_type_; |
55 | 50 |
56 // Notification for connection errors | 51 // Notification for connection errors |
57 SystemNotification notification_connection_error_; | 52 SystemNotification notification_connection_error_; |
58 // Notification for showing low data warning | 53 // Notification for showing low data warning |
59 SystemNotification notification_low_data_; | 54 SystemNotification notification_low_data_; |
60 // Notification for showing no data warning | 55 // Notification for showing no data warning |
61 SystemNotification notification_no_data_; | 56 SystemNotification notification_no_data_; |
62 | 57 |
63 DISALLOW_COPY_AND_ASSIGN(NetworkMessageObserver); | 58 DISALLOW_COPY_AND_ASSIGN(NetworkMessageObserver); |
64 }; | 59 }; |
65 | 60 |
66 } // namespace chromeos | 61 } // namespace chromeos |
67 | 62 |
68 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_MESSAGE_OBSERVER_H_ | 63 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_MESSAGE_OBSERVER_H_ |
OLD | NEW |