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

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

Issue 2078773003: Realign message center popups when displays are added or removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/desktop_popup_alignment_delegate.cc
diff --git a/ui/message_center/views/desktop_popup_alignment_delegate.cc b/ui/message_center/views/desktop_popup_alignment_delegate.cc
index f67200def64ace65e3e331bb51c73008d401fac8..9ed93d35e1c94db35a7dac8422989e847e543314 100644
--- a/ui/message_center/views/desktop_popup_alignment_delegate.cc
+++ b/ui/message_center/views/desktop_popup_alignment_delegate.cc
@@ -84,10 +84,24 @@ void DesktopPopupAlignmentDelegate::RecomputeAlignment(
}
void DesktopPopupAlignmentDelegate::OnDisplayAdded(
- const display::Display& new_display) {}
+ const display::Display& new_display) {
dewittj 2016/06/20 17:06:00 rename to added_display
Jun Mukai 2016/06/20 20:28:54 Can you also leave a comment for why these are nec
osandov 2016/06/21 08:01:05 Done.
osandov 2016/06/21 08:01:06 Done.
+ display::Display display = screen_->GetPrimaryDisplay();
dewittj 2016/06/20 17:06:00 nit: rename to primary_display
osandov 2016/06/21 08:01:05 This moved after refactoring, but also done.
+ if (new_display.id() == display.id() && display.id() != display_id_) {
+ display_id_ = display.id();
+ RecomputeAlignment(display);
dewittj 2016/06/20 17:06:00 Lots of code duplication between these, could you
osandov 2016/06/21 08:01:06 Done.
+ DoUpdateIfPossible();
+ }
+}
void DesktopPopupAlignmentDelegate::OnDisplayRemoved(
- const display::Display& old_display) {}
+ const display::Display& old_display) {
dewittj 2016/06/20 17:06:00 rename to removed_display
osandov 2016/06/21 08:01:06 Done.
+ if (old_display.id() == display_id_) {
+ display::Display display = screen_->GetPrimaryDisplay();
dewittj 2016/06/20 17:05:59 primary_display
osandov 2016/06/21 08:01:06 Done, moved in the refactoring.
+ display_id_ = display.id();
+ RecomputeAlignment(display);
+ DoUpdateIfPossible();
+ }
+}
void DesktopPopupAlignmentDelegate::OnDisplayMetricsChanged(
const display::Display& display,
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698