| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "ui/arc/notification/arc_custom_notification_item.h" | 5 #include "ui/arc/notification/arc_custom_notification_item.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 std::unique_ptr<message_center::CustomContent> CreateCustomContent() | 32 std::unique_ptr<message_center::CustomContent> CreateCustomContent() |
| 33 override { | 33 override { |
| 34 auto view = base::MakeUnique<ArcCustomNotificationView>(item_); | 34 auto view = base::MakeUnique<ArcCustomNotificationView>(item_); |
| 35 auto content_view_delegate = view->CreateContentViewDelegate(); | 35 auto content_view_delegate = view->CreateContentViewDelegate(); |
| 36 return base::MakeUnique<message_center::CustomContent>( | 36 return base::MakeUnique<message_center::CustomContent>( |
| 37 std::move(view), std::move(content_view_delegate)); | 37 std::move(view), std::move(content_view_delegate)); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void Close(bool by_user) override { item_->Close(by_user); } | 40 void Close(bool by_user) override { item_->Close(by_user); } |
| 41 | 41 |
| 42 void Click() override { item_->Click(); } |
| 43 |
| 42 private: | 44 private: |
| 43 // The destructor is private since this class is ref-counted. | 45 // The destructor is private since this class is ref-counted. |
| 44 ~ArcNotificationDelegate() override {} | 46 ~ArcNotificationDelegate() override {} |
| 45 | 47 |
| 46 ArcCustomNotificationItem* const item_; | 48 ArcCustomNotificationItem* const item_; |
| 47 | 49 |
| 48 DISALLOW_COPY_AND_ASSIGN(ArcNotificationDelegate); | 50 DISALLOW_COPY_AND_ASSIGN(ArcNotificationDelegate); |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 } // namespace | 53 } // namespace |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 130 } |
| 129 | 131 |
| 130 void ArcCustomNotificationItem::DecrementWindowRefCount() { | 132 void ArcCustomNotificationItem::DecrementWindowRefCount() { |
| 131 DCHECK_GT(window_ref_count_, 0); | 133 DCHECK_GT(window_ref_count_, 0); |
| 132 --window_ref_count_; | 134 --window_ref_count_; |
| 133 if (window_ref_count_ == 0) | 135 if (window_ref_count_ == 0) |
| 134 manager()->CloseNotificationWindow(notification_key()); | 136 manager()->CloseNotificationWindow(notification_key()); |
| 135 } | 137 } |
| 136 | 138 |
| 137 } // namespace arc | 139 } // namespace arc |
| OLD | NEW |