Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: ui/arc/notification/arc_notification_delegate.cc

Issue 2845003002: Merge ArcNotificationItem and ArcCustomNotificationItem (Closed)
Patch Set: Rebased Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « ui/arc/notification/arc_notification_delegate.h ('k') | ui/arc/notification/arc_notification_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698