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

Side by Side Diff: ui/message_center/views/message_popup_collection.h

Issue 259253002: Add OnDisplayMetricsChanged in DisplayObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_orientation
Patch Set: Created 6 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
« no previous file with comments | « ui/gfx/display_observer.h ('k') | ui/message_center/views/message_popup_collection.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 (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
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
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_
OLDNEW
« no previous file with comments | « ui/gfx/display_observer.h ('k') | ui/message_center/views/message_popup_collection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698