OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ | 5 #ifndef UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ |
6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ | 6 #define UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // Runs the next step in update/animate sequence, if the defer counter is not | 104 // Runs the next step in update/animate sequence, if the defer counter is not |
105 // zero. Otherwise, simply waits when it becomes zero. | 105 // zero. Otherwise, simply waits when it becomes zero. |
106 void DoUpdateIfPossible(); | 106 void DoUpdateIfPossible(); |
107 | 107 |
108 // Removes the toast from our internal list of toasts; this is called when the | 108 // Removes the toast from our internal list of toasts; this is called when the |
109 // toast is irrevocably closed (such as within RemoveToast). | 109 // toast is irrevocably closed (such as within RemoveToast). |
110 void ForgetToast(ToastContentsView* toast); | 110 void ForgetToast(ToastContentsView* toast); |
111 | 111 |
112 // Updates |work_area_| and re-calculates the alignment of notification toasts | 112 // Updates |work_area_| and re-calculates the alignment of notification toasts |
113 // rearranging them if necessary. | 113 // rearranging them if necessary. |
114 // This is separated from methods from OnDisplayBoundsChanged(), since | 114 // This is separated from methods from OnDisplayMetricsChanged(), since |
115 // sometimes the display info has to be specified directly. One example is | 115 // sometimes the display info has to be specified directly. One example is |
116 // shelf's auto-hide change. When the shelf in ChromeOS is temporarily shown | 116 // shelf's auto-hide change. When the shelf in ChromeOS is temporarily shown |
117 // from auto hide status, it doesn't change the display's work area but the | 117 // from auto hide status, it doesn't change the display's work area but the |
118 // actual work area for toasts should be resized. | 118 // actual work area for toasts should be resized. |
119 void SetDisplayInfo(const gfx::Rect& work_area, | 119 void SetDisplayInfo(const gfx::Rect& work_area, |
120 const gfx::Rect& screen_bounds); | 120 const gfx::Rect& screen_bounds); |
121 | 121 |
122 // Overridden from gfx::DislayObserver: | 122 // Overridden from gfx::DislayObserver: |
123 virtual void OnDisplayBoundsChanged(const gfx::Display& display) OVERRIDE; | |
124 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; | 123 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; |
125 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; | 124 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; |
| 125 virtual void OnDisplayMetricsChanged(const gfx::Display& display, |
| 126 uint32_t metrics) OVERRIDE; |
126 | 127 |
127 // Used by ToastContentsView to locate itself. | 128 // Used by ToastContentsView to locate itself. |
128 gfx::NativeView parent() const { return parent_; } | 129 gfx::NativeView parent() const { return parent_; } |
129 | 130 |
130 private: | 131 private: |
131 FRIEND_TEST_ALL_PREFIXES(ash::WebNotificationTrayTest, | 132 FRIEND_TEST_ALL_PREFIXES(ash::WebNotificationTrayTest, |
132 ManyPopupNotifications); | 133 ManyPopupNotifications); |
133 friend class test::MessagePopupCollectionTest; | 134 friend class test::MessagePopupCollectionTest; |
134 friend class ash::WebNotificationTrayTest; | 135 friend class ash::WebNotificationTrayTest; |
135 typedef std::list<ToastContentsView*> Toasts; | 136 typedef std::list<ToastContentsView*> Toasts; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 // Gives out weak pointers to toast contents views which have an unrelated | 223 // Gives out weak pointers to toast contents views which have an unrelated |
223 // lifetime. Must remain the last member variable. | 224 // lifetime. Must remain the last member variable. |
224 base::WeakPtrFactory<MessagePopupCollection> weak_factory_; | 225 base::WeakPtrFactory<MessagePopupCollection> weak_factory_; |
225 | 226 |
226 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection); | 227 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection); |
227 }; | 228 }; |
228 | 229 |
229 } // namespace message_center | 230 } // namespace message_center |
230 | 231 |
231 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ | 232 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ |
OLD | NEW |