OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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_NOTIFICATION_ITEM_IMPL_H_ | 5 #ifndef UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_IMPL_H_ |
6 #define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_IMPL_H_ | 6 #define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 void AddObserver(Observer* observer) override; | 41 void AddObserver(Observer* observer) override; |
42 void RemoveObserver(Observer* observer) override; | 42 void RemoveObserver(Observer* observer) override; |
43 void IncrementWindowRefCount() override; | 43 void IncrementWindowRefCount() override; |
44 void DecrementWindowRefCount() override; | 44 void DecrementWindowRefCount() override; |
45 bool GetPinned() const override; | 45 bool GetPinned() const override; |
46 const gfx::ImageSkia& GetSnapshot() const override; | 46 const gfx::ImageSkia& GetSnapshot() const override; |
47 mojom::ArcNotificationExpandState GetExpandState() const override; | 47 mojom::ArcNotificationExpandState GetExpandState() const override; |
48 mojom::ArcNotificationShownContents GetShownContents() const override; | 48 mojom::ArcNotificationShownContents GetShownContents() const override; |
49 const std::string& GetNotificationKey() const override; | 49 const std::string& GetNotificationKey() const override; |
50 const std::string& GetNotificationId() const override; | 50 const std::string& GetNotificationId() const override; |
| 51 const base::string16& GetAccessibleName() const override; |
51 | 52 |
52 private: | 53 private: |
53 // Return true if it's on the thread this instance is created on. | 54 // Return true if it's on the thread this instance is created on. |
54 bool CalledOnValidThread() const; | 55 bool CalledOnValidThread() const; |
55 | 56 |
56 ArcNotificationManager* const manager_; | 57 ArcNotificationManager* const manager_; |
57 message_center::MessageCenter* const message_center_; | 58 message_center::MessageCenter* const message_center_; |
58 | 59 |
59 // The pinned state of the latest notification. | 60 // The pinned state of the latest notification. |
60 bool pinned_ = false; | 61 bool pinned_ = false; |
61 // The snapshot of the latest notification. | 62 // The snapshot of the latest notification. |
62 gfx::ImageSkia snapshot_; | 63 gfx::ImageSkia snapshot_; |
63 // The expand state of the latest notification. | 64 // The expand state of the latest notification. |
64 mojom::ArcNotificationExpandState expand_state_ = | 65 mojom::ArcNotificationExpandState expand_state_ = |
65 mojom::ArcNotificationExpandState::FIXED_SIZE; | 66 mojom::ArcNotificationExpandState::FIXED_SIZE; |
66 // The type of shown content of the latest notification. | 67 // The type of shown content of the latest notification. |
67 mojom::ArcNotificationShownContents shown_contents_ = | 68 mojom::ArcNotificationShownContents shown_contents_ = |
68 mojom::ArcNotificationShownContents::CONTENTS_SHOWN; | 69 mojom::ArcNotificationShownContents::CONTENTS_SHOWN; |
69 // The reference counter of the window. | 70 // The reference counter of the window. |
70 int window_ref_count_ = 0; | 71 int window_ref_count_ = 0; |
| 72 // The accessible name of the latest notification. |
| 73 base::string16 accessible_name_; |
71 | 74 |
72 base::ObserverList<Observer> observers_; | 75 base::ObserverList<Observer> observers_; |
73 | 76 |
74 const AccountId profile_id_; | 77 const AccountId profile_id_; |
75 const std::string notification_key_; | 78 const std::string notification_key_; |
76 const std::string notification_id_; | 79 const std::string notification_id_; |
77 | 80 |
78 // The flag to indicate that the removing is initiated by the manager and we | 81 // The flag to indicate that the removing is initiated by the manager and we |
79 // don't need to notify a remove event to the manager. | 82 // don't need to notify a remove event to the manager. |
80 // This is true only when: | 83 // This is true only when: |
81 // (1) the notification is being removed | 84 // (1) the notification is being removed |
82 // (2) the removing is initiated by manager | 85 // (2) the removing is initiated by manager |
83 bool being_removed_by_manager_ = false; | 86 bool being_removed_by_manager_ = false; |
84 | 87 |
85 base::ThreadChecker thread_checker_; | 88 base::ThreadChecker thread_checker_; |
86 base::WeakPtrFactory<ArcNotificationItemImpl> weak_ptr_factory_; | 89 base::WeakPtrFactory<ArcNotificationItemImpl> weak_ptr_factory_; |
87 | 90 |
88 DISALLOW_COPY_AND_ASSIGN(ArcNotificationItemImpl); | 91 DISALLOW_COPY_AND_ASSIGN(ArcNotificationItemImpl); |
89 }; | 92 }; |
90 | 93 |
91 } // namespace arc | 94 } // namespace arc |
92 | 95 |
93 #endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_IMPL_H_ | 96 #endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_ITEM_IMPL_H_ |
OLD | NEW |