OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 #include "ui/arc/notification/arc_notification_delegate.h" |
| 6 |
| 7 #include "ui/arc/notification/arc_custom_notification_view.h" |
| 8 #include "ui/arc/notification/arc_notification_item.h" |
| 9 |
| 10 namespace arc { |
| 11 |
| 12 ArcNotificationDelegate::ArcNotificationDelegate( |
| 13 base::WeakPtr<ArcNotificationItem> item) |
| 14 : item_(item) { |
| 15 DCHECK(item_); |
| 16 } |
| 17 |
| 18 ArcNotificationDelegate::~ArcNotificationDelegate() {} |
| 19 |
| 20 std::unique_ptr<message_center::CustomContent> |
| 21 ArcNotificationDelegate::CreateCustomContent() { |
| 22 DCHECK(item_); |
| 23 auto view = base::MakeUnique<ArcCustomNotificationView>(item_.get()); |
| 24 auto content_view_delegate = view->CreateContentViewDelegate(); |
| 25 return base::MakeUnique<message_center::CustomContent>( |
| 26 std::move(view), std::move(content_view_delegate)); |
| 27 } |
| 28 |
| 29 void ArcNotificationDelegate::Close(bool by_user) { |
| 30 DCHECK(item_); |
| 31 item_->Close(by_user); |
| 32 } |
| 33 |
| 34 void ArcNotificationDelegate::Click() { |
| 35 DCHECK(item_); |
| 36 item_->Click(); |
| 37 } |
| 38 |
| 39 } // namespace arc |
OLD | NEW |