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

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

Issue 294963004: Revert of 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 OnDisplayMetricsChanged(), since 114 // This is separated from methods from OnDisplayBoundsChanged(), 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;
123 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; 124 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE;
124 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; 125 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE;
125 virtual void OnDisplayMetricsChanged(const gfx::Display& display,
126 uint32_t metrics) OVERRIDE;
127 126
128 // Used by ToastContentsView to locate itself. 127 // Used by ToastContentsView to locate itself.
129 gfx::NativeView parent() const { return parent_; } 128 gfx::NativeView parent() const { return parent_; }
130 129
131 private: 130 private:
132 FRIEND_TEST_ALL_PREFIXES(ash::WebNotificationTrayTest, 131 FRIEND_TEST_ALL_PREFIXES(ash::WebNotificationTrayTest,
133 ManyPopupNotifications); 132 ManyPopupNotifications);
134 friend class test::MessagePopupCollectionTest; 133 friend class test::MessagePopupCollectionTest;
135 friend class ash::WebNotificationTrayTest; 134 friend class ash::WebNotificationTrayTest;
136 typedef std::list<ToastContentsView*> Toasts; 135 typedef std::list<ToastContentsView*> Toasts;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // Gives out weak pointers to toast contents views which have an unrelated 222 // Gives out weak pointers to toast contents views which have an unrelated
224 // lifetime. Must remain the last member variable. 223 // lifetime. Must remain the last member variable.
225 base::WeakPtrFactory<MessagePopupCollection> weak_factory_; 224 base::WeakPtrFactory<MessagePopupCollection> weak_factory_;
226 225
227 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection); 226 DISALLOW_COPY_AND_ASSIGN(MessagePopupCollection);
228 }; 227 };
229 228
230 } // namespace message_center 229 } // namespace message_center
231 230
232 #endif // UI_MESSAGE_CENTER_VIEWS_MESSAGE_POPUP_COLLECTION_H_ 231 #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