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

Unified Diff: ui/views/widget/desktop_aura/desktop_screen_x11.cc

Issue 259253002: Add OnDisplayMetricsChanged in DisplayObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_orientation
Patch Set: with Linux Aura tests 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/desktop_aura/desktop_screen_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.cc b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
index d9277807d443470b824144ab0ff48af2ccfcadfe..5fb28dda871a1f6ac2a391f1e9fe068eed9731eb 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
@@ -137,15 +137,28 @@ void DesktopScreenX11::ProcessDisplayChange(
bool found = false;
for (std::vector<gfx::Display>::const_iterator old_it =
old_displays.begin(); old_it != old_displays.end(); ++old_it) {
- if (new_it->id() == old_it->id()) {
- if (new_it->bounds() != old_it->bounds()) {
- FOR_EACH_OBSERVER(gfx::DisplayObserver, observer_list_,
- OnDisplayBoundsChanged(*new_it));
- }
+ if (new_it->id() != old_it->id())
+ continue;
- found = true;
- break;
+ int metrics = gfx::DisplayObserver::DISPLAY_METRICS_NONE;
+
+ if (new_it->bounds() != old_it->bounds())
+ metrics |= gfx::DisplayObserver::DISPLAY_METRICS_BOUNDS;
+
+ if (new_it->rotation() != old_it->rotation())
+ metrics |= gfx::DisplayObserver::DISPLAY_METRICS_ROTATION;
+
+ if (new_it->work_area() != old_it->work_area())
+ metrics |= gfx::DisplayObserver::DISPLAY_METRICS_WORKAREA;
+
+ if (metrics != gfx::DisplayObserver::DISPLAY_METRICS_NONE) {
+ FOR_EACH_OBSERVER(gfx::DisplayObserver, observer_list_,
+ OnDisplayMetricsChanged(*new_it,
+ static_cast<gfx::DisplayObserver::MetricsType>(metrics)));
}
+
+ found = true;
+ break;
}
if (!found) {

Powered by Google App Engine
This is Rietveld 408576698