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

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

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 #ifndef UI_ARC_NOTIFICATION_ARC_CUSTOM_DELEGATE_H_
6 #define UI_ARC_NOTIFICATION_ARC_CUSTOM_DELEGATE_H_
7
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "ui/message_center/notification_delegate.h"
11
12 namespace arc {
13
14 class ArcNotificationItem;
15
16 /*
17 * Implementation of NotificationDelegate for ARC notifications.
18 */
19 class ArcNotificationDelegate : public message_center::NotificationDelegate {
20 public:
21 explicit ArcNotificationDelegate(base::WeakPtr<ArcNotificationItem> item);
22
23 // message_center::NotificationDelegate overrides:
24 std::unique_ptr<message_center::CustomContent> CreateCustomContent() override;
25 void Close(bool by_user) override;
26 void Click() override;
27
28 private:
29 // The destructor is private since this class is ref-counted.
30 ~ArcNotificationDelegate() override;
31
32 // We use weak ptr to detect potential use-after-free. The lives of objects
33 // around ARC notification is somewhat complex so we want to use it until
34 // it gets stable.
35 base::WeakPtr<ArcNotificationItem> item_;
36
37 DISALLOW_COPY_AND_ASSIGN(ArcNotificationDelegate);
38 };
39
40 } // namespace arc
41
42 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view.cc ('k') | ui/arc/notification/arc_notification_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698