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

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

Issue 2845003002: Merge ArcNotificationItem and ArcCustomNotificationItem (Closed)
Patch Set: . 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
Index: ui/arc/notification/arc_notification_delegate.h
diff --git a/ui/arc/notification/arc_notification_delegate.h b/ui/arc/notification/arc_notification_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..17b60877ade37a91c6e5b2286e518be986ec4508
--- /dev/null
+++ b/ui/arc/notification/arc_notification_delegate.h
@@ -0,0 +1,39 @@
+// 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.
+
+#ifndef UI_ARC_NOTIFICATION_ARC_CUSTOM_DELEGATE_H_
+#define UI_ARC_NOTIFICATION_ARC_CUSTOM_DELEGATE_H_
+
+#include "base/macros.h"
+#include "base/memory/ptr_util.h"
hidehiko 2017/05/08 09:34:41 Sorry, I overlooked in the last cycle. Looks unnec
yoshiki 2017/05/08 09:51:52 Done.
+#include "base/memory/weak_ptr.h"
+#include "ui/arc/notification/arc_notification_item.h"
hidehiko 2017/05/08 09:34:41 Ditto. Can be forward decl, instead?
yoshiki 2017/05/08 09:51:52 Done.
+#include "ui/message_center/notification_delegate.h"
+
+namespace arc {
+
+/*
+ * Implementation of NotificationDelegate for ARC notifications.
+ */
+class ArcNotificationDelegate : public message_center::NotificationDelegate {
+ public:
+ explicit ArcNotificationDelegate(base::WeakPtr<ArcNotificationItem> item);
+
+ // message_center::NotificationDelegate overrides:
+ std::unique_ptr<message_center::CustomContent> CreateCustomContent() override;
+ void Close(bool by_user) override;
+ void Click() override;
+
+ private:
+ // The destructor is private since this class is ref-counted.
+ ~ArcNotificationDelegate() override;
+
+ base::WeakPtr<ArcNotificationItem> item_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcNotificationDelegate);
+};
+
+} // namespace arc
+
+#endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698