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

Unified Diff: ui/message_center/views/message_popup_collection.cc

Issue 19291004: Observes work area change and auto-hide for notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 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 side-by-side diff with in-line comments
Download patch
Index: ui/message_center/views/message_popup_collection.cc
diff --git a/ui/message_center/views/message_popup_collection.cc b/ui/message_center/views/message_popup_collection.cc
index b5b13f909977fecb8453ac92ed73afebbc4911c2..7d24a2f7520ccb6b4e7a382eba3304411959ec41 100644
--- a/ui/message_center/views/message_popup_collection.cc
+++ b/ui/message_center/views/message_popup_collection.cc
@@ -318,10 +318,6 @@ void MessagePopupCollection::OnNotificationUpdated(
DoUpdateIfPossible();
}
-void MessagePopupCollection::SetWorkAreaForTest(const gfx::Rect& work_area) {
- work_area_ = work_area;
-}
-
ToastContentsView* MessagePopupCollection::FindToast(
const std::string& notification_id) {
for (Toasts::iterator iter = toasts_.begin(); iter != toasts_.end(); ++iter) {
@@ -369,15 +365,20 @@ void MessagePopupCollection::DoUpdateIfPossible() {
run_loop_for_test_->Quit();
}
+void MessagePopupCollection::SetWorkArea(const gfx::Rect& work_area) {
+ if (work_area_ == work_area)
+ return;
+
+ work_area_ = work_area;
+ RepositionWidgets();
+}
+
void MessagePopupCollection::OnDisplayBoundsChanged(
const gfx::Display& display) {
if (display.id() != display_id_)
return;
- if (work_area_ == display.work_area())
- return;
- work_area_ = display.work_area();
- RepositionWidgets();
+ SetWorkArea(display.work_area());
}
void MessagePopupCollection::OnDisplayAdded(const gfx::Display& new_display) {
« no previous file with comments | « ui/message_center/views/message_popup_collection.h ('k') | ui/message_center/views/message_popup_collection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698