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

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

Issue 2093563007: Add a floating close button for arc custom notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo 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 | « ui/arc/notification/DEPS ('k') | 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 "ui/arc/notification/arc_notification_item.h" 10 #include "ui/arc/notification/arc_notification_item.h"
10 #include "ui/arc/notification/arc_notification_surface_manager.h" 11 #include "ui/arc/notification/arc_notification_surface_manager.h"
11 12
12 namespace arc { 13 namespace arc {
13 14
14 class ArcCustomNotificationItem 15 class ArcCustomNotificationItem
15 : public ArcNotificationItem, 16 : public ArcNotificationItem,
16 public ArcNotificationSurfaceManager::Observer { 17 public ArcNotificationSurfaceManager::Observer {
17 public: 18 public:
19 class Observer {
20 public:
21 // Invoked when the notification data for this item has changed.
22 virtual void OnItemDestroying() = 0;
23
24 // Invoked when the pinned stated is changed.
25 virtual void OnItemPinnedChanged() = 0;
26
27 protected:
28 virtual ~Observer() = default;
29 };
30
18 ArcCustomNotificationItem(ArcNotificationManager* manager, 31 ArcCustomNotificationItem(ArcNotificationManager* manager,
19 message_center::MessageCenter* message_center, 32 message_center::MessageCenter* message_center,
20 const std::string& notification_key, 33 const std::string& notification_key,
21 const AccountId& profile_id); 34 const AccountId& profile_id);
22 ~ArcCustomNotificationItem() override; 35 ~ArcCustomNotificationItem() override;
23 36
24 void UpdateWithArcNotificationData( 37 void UpdateWithArcNotificationData(
25 const mojom::ArcNotificationData& data) override; 38 const mojom::ArcNotificationData& data) override;
26 39
40 void CloseFromCloseButton();
41
42 void AddObserver(Observer* observer);
43 void RemoveObserver(Observer* observer);
44
45 bool pinned() const { return pinned_; }
46
27 private: 47 private:
28 // ArcNotificationSurfaceManager::Observer: 48 // ArcNotificationSurfaceManager::Observer:
29 void OnNotificationSurfaceAdded(exo::NotificationSurface* surface) override; 49 void OnNotificationSurfaceAdded(exo::NotificationSurface* surface) override;
30 void OnNotificationSurfaceRemoved(exo::NotificationSurface* surface) override; 50 void OnNotificationSurfaceRemoved(exo::NotificationSurface* surface) override;
31 51
52 bool pinned_ = false;
53 base::ObserverList<Observer> observers_;
54
32 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationItem); 55 DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationItem);
33 }; 56 };
34 57
35 } // namespace arc 58 } // namespace arc
36 59
37 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_ITEM_H_ 60 #endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_ITEM_H_
OLDNEW
« no previous file with comments | « ui/arc/notification/DEPS ('k') | ui/arc/notification/arc_custom_notification_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698