OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "chrome/browser/chromeos/cros/network_library.h" | 15 #include "chrome/browser/chromeos/cros/network_library.h" |
16 #include "chrome/browser/chromeos/notifications/system_notification.h" | |
17 | 16 |
18 class Profile; | 17 class Profile; |
19 | 18 |
20 namespace chromeos { | 19 namespace chromeos { |
21 | 20 |
22 // The network message observer displays a system notification for network | 21 // The network message observer displays a system notification for network |
23 // messages. | 22 // messages. |
24 | 23 |
| 24 class NetworkMessageNotification; |
| 25 |
25 class NetworkMessageObserver | 26 class NetworkMessageObserver |
26 : public NetworkLibrary::NetworkManagerObserver, | 27 : public NetworkLibrary::NetworkManagerObserver, |
27 public NetworkLibrary::CellularDataPlanObserver, | 28 public NetworkLibrary::CellularDataPlanObserver, |
28 public NetworkLibrary::UserActionObserver, | 29 public NetworkLibrary::UserActionObserver, |
29 public base::SupportsWeakPtr<NetworkMessageObserver> { | 30 public base::SupportsWeakPtr<NetworkMessageObserver> { |
30 public: | 31 public: |
31 explicit NetworkMessageObserver(Profile* profile); | 32 explicit NetworkMessageObserver(Profile* profile); |
32 virtual ~NetworkMessageObserver(); | 33 virtual ~NetworkMessageObserver(); |
33 | 34 |
34 static bool IsApplicableBackupPlan(const CellularDataPlan* plan, | 35 static bool IsApplicableBackupPlan(const CellularDataPlan* plan, |
(...skipping 24 matching lines...) Expand all Loading... |
59 // Current connect celluar service path. | 60 // Current connect celluar service path. |
60 std::string cellular_service_path_; | 61 std::string cellular_service_path_; |
61 // Last cellular data plan unique id. | 62 // Last cellular data plan unique id. |
62 std::string cellular_data_plan_unique_id_; | 63 std::string cellular_data_plan_unique_id_; |
63 // Last cellular data plan type. | 64 // Last cellular data plan type. |
64 CellularDataPlanType cellular_data_plan_type_; | 65 CellularDataPlanType cellular_data_plan_type_; |
65 // Last cellular data left. | 66 // Last cellular data left. |
66 CellularNetwork::DataLeft cellular_data_left_; | 67 CellularNetwork::DataLeft cellular_data_left_; |
67 | 68 |
68 // Notification for connection errors | 69 // Notification for connection errors |
69 SystemNotification notification_connection_error_; | 70 scoped_ptr<NetworkMessageNotification> notification_connection_error_; |
70 // Notification for showing low data warning | 71 // Notification for showing low data warning |
71 SystemNotification notification_low_data_; | 72 scoped_ptr<NetworkMessageNotification> notification_low_data_; |
72 // Notification for showing no data warning | 73 // Notification for showing no data warning |
73 SystemNotification notification_no_data_; | 74 scoped_ptr<NetworkMessageNotification> notification_no_data_; |
74 | 75 |
75 DISALLOW_COPY_AND_ASSIGN(NetworkMessageObserver); | 76 DISALLOW_COPY_AND_ASSIGN(NetworkMessageObserver); |
76 }; | 77 }; |
77 | 78 |
78 } // namespace chromeos | 79 } // namespace chromeos |
79 | 80 |
80 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_MESSAGE_OBSERVER_H_ | 81 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_MESSAGE_OBSERVER_H_ |
OLD | NEW |