OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_POWER_DUAL_ROLE_NOTIFICATION_H_ | |
6 #define ASH_COMMON_SYSTEM_CHROMEOS_POWER_DUAL_ROLE_NOTIFICATION_H_ | |
7 | |
8 #include <stddef.h> | |
9 | |
10 #include <memory> | |
11 | |
12 #include "ash/ash_export.h" | |
13 #include "ash/common/system/chromeos/power/power_status.h" | |
14 #include "base/macros.h" | |
15 | |
16 namespace message_center { | |
17 class MessageCenter; | |
18 class Notification; | |
19 } | |
20 | |
21 namespace ash { | |
22 | |
23 // Shows a non-toasting MessageCenter notification based on what dual-role | |
24 // devices are connected. | |
25 class ASH_EXPORT DualRoleNotification { | |
26 public: | |
27 explicit DualRoleNotification(message_center::MessageCenter* message_center); | |
28 ~DualRoleNotification(); | |
29 | |
30 // Creates or updates the notification. | |
31 void Update(); | |
32 | |
33 private: | |
34 // Creates the notification using the updated status. | |
35 std::unique_ptr<message_center::Notification> CreateNotification(); | |
36 | |
37 message_center::MessageCenter* message_center_; | |
38 std::unique_ptr<PowerStatus::PowerSource> dual_role_source_; | |
39 std::unique_ptr<PowerStatus::PowerSource> dual_role_sink_; | |
40 size_t num_dual_role_sinks_; | |
41 bool line_power_connected_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(DualRoleNotification); | |
44 }; | |
45 | |
46 } // namespace ash | |
47 | |
48 #endif // ASH_COMMON_SYSTEM_CHROMEOS_POWER_DUAL_ROLE_NOTIFICATION_H_ | |
OLD | NEW |