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

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: 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..fef23aa5ed0d81c1e153915294eaf59c87a5c415 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
@@ -137,15 +137,31 @@ 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;
+ uint32_t metrics = gfx::DisplayObserver::DISPLAY_METRIC_NONE;
+
+ if (new_it->bounds() != old_it->bounds())
+ metrics |= gfx::DisplayObserver::DISPLAY_METRIC_BOUNDS;
+
+ if (new_it->rotation() != old_it->rotation())
+ metrics |= gfx::DisplayObserver::DISPLAY_METRIC_ROTATION;
+
+ if (new_it->work_area() != old_it->work_area())
+ metrics |= gfx::DisplayObserver::DISPLAY_METRIC_WORK_AREA;
+
+ if (new_it->device_scale_factor() != old_it->device_scale_factor())
+ metrics |= gfx::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR;
+
+ if (metrics != gfx::DisplayObserver::DISPLAY_METRIC_NONE) {
+ FOR_EACH_OBSERVER(gfx::DisplayObserver,
+ observer_list_,
+ OnDisplayMetricsChanged(*new_it, metrics));
}
+
+ found = true;
+ break;
}
if (!found) {
« no previous file with comments | « ui/message_center/views/toast_contents_view.cc ('k') | ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698