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

Unified Diff: ui/arc/notification/arc_notification_delegate.cc

Issue 2845003002: Merge ArcNotificationItem and ArcCustomNotificationItem (Closed)
Patch Set: Addressed comments (#56) 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/arc/notification/arc_notification_delegate.cc
diff --git a/ui/arc/notification/arc_notification_delegate.cc b/ui/arc/notification/arc_notification_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..22c6e23749a4a9f788597dd37017536897e15551
--- /dev/null
+++ b/ui/arc/notification/arc_notification_delegate.cc
@@ -0,0 +1,38 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/arc/notification/arc_notification_delegate.h"
+
+#include "ui/arc/notification/arc_custom_notification_view.h"
+
hidehiko 2017/05/08 10:12:39 Missing #include "ui/arc/notification/arc_notifica
yoshiki 2017/05/08 14:31:19 Done.
+namespace arc {
+
+ArcNotificationDelegate::ArcNotificationDelegate(
+ base::WeakPtr<ArcNotificationItem> item)
+ : item_(item) {
+ DCHECK(item_);
+}
+
+ArcNotificationDelegate::~ArcNotificationDelegate() {}
+
+std::unique_ptr<message_center::CustomContent>
+ArcNotificationDelegate::CreateCustomContent() {
+ DCHECK(item_);
+ auto view = base::MakeUnique<ArcCustomNotificationView>(item_.get());
+ auto content_view_delegate = view->CreateContentViewDelegate();
+ return base::MakeUnique<message_center::CustomContent>(
+ std::move(view), std::move(content_view_delegate));
+}
+
+void ArcNotificationDelegate::Close(bool by_user) {
+ DCHECK(item_);
+ item_->Close(by_user);
+}
+
+void ArcNotificationDelegate::Click() {
+ DCHECK(item_);
+ item_->Click();
+}
+
+} // namespace arc
« 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