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

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

Issue 2120593002: arc: Fix custom notification crash on closing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | ui/arc/notification/arc_custom_notification_item.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_ITEM_H_ 5 #ifndef UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_ITEM_H_
6 #define UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_ITEM_H_ 6 #define UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_ITEM_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/observer_list.h" 9 #include "base/observer_list.h"
10 #include "ui/arc/notification/arc_notification_item.h" 10 #include "ui/arc/notification/arc_notification_item.h"
11 #include "ui/arc/notification/arc_notification_surface_manager.h" 11 #include "ui/arc/notification/arc_notification_surface_manager.h"
12 12
13 namespace arc { 13 namespace arc {
14 14
15 class ArcCustomNotificationItem 15 class ArcCustomNotificationItem
16 : public ArcNotificationItem, 16 : public ArcNotificationItem,
17 public ArcNotificationSurfaceManager::Observer { 17 public ArcNotificationSurfaceManager::Observer {
18 public: 18 public:
19 class Observer { 19 class Observer {
20 public: 20 public:
21 // Invoked when the notification data for this item has changed. 21 // Invoked when the notification data for this item has changed.
22 virtual void OnItemDestroying() = 0; 22 virtual void OnItemDestroying() = 0;
23 23
24 // Invoked when the pinned stated is changed. 24 // Invoked when the pinned stated is changed.
25 virtual void OnItemPinnedChanged() = 0; 25 virtual void OnItemPinnedChanged() = 0;
26 26
27 // Invoked when the notification surface for this item is gone.
28 virtual void OnItemNotificationSurfaceRemoved() = 0;
29
27 protected: 30 protected:
28 virtual ~Observer() = default; 31 virtual ~Observer() = default;
29 }; 32 };
30 33
31 ArcCustomNotificationItem(ArcNotificationManager* manager, 34 ArcCustomNotificationItem(ArcNotificationManager* manager,
32 message_center::MessageCenter* message_center, 35 message_center::MessageCenter* message_center,
33 const std::string& notification_key, 36 const std::string& notification_key,
34 const AccountId& profile_id); 37 const AccountId& profile_id);
35 ~ArcCustomNotificationItem() override; 38 ~ArcCustomNotificationItem() override;
36 39
(...skipping 14 matching lines...) Expand all
51 54
52 bool pinned_ = false; 55 bool pinned_ = false;
53 base::ObserverList<Observer> observers_; 56 base::ObserverList<Observer> observers_;
54 57
55 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationItem); 58 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationItem);
56 }; 59 };
57 60
58 } // namespace arc 61 } // namespace arc
59 62
60 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_ITEM_H_ 63 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_ITEM_H_
OLDNEW
« no previous file with comments | « no previous file | ui/arc/notification/arc_custom_notification_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698