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