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

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

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 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 fef23aa5ed0d81c1e153915294eaf59c87a5c415..d9277807d443470b824144ab0ff48af2ccfcadfe 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
@@ -137,31 +137,15 @@
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())
- continue;
-
- 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 (new_it->id() == old_it->id()) {
+ if (new_it->bounds() != old_it->bounds()) {
+ FOR_EACH_OBSERVER(gfx::DisplayObserver, observer_list_,
+ OnDisplayBoundsChanged(*new_it));
+ }
+
+ 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