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

Unified Diff: ash/display/display_manager.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: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 0f3bddaaf140c5b186d3b2de6a8ee3b1d3d5c211..9f483094ecc141ad5eede25fee6eefe2c90eb990 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -27,6 +27,7 @@
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/display.h"
+#include "ui/gfx/display_observer.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/size_conversions.h"
@@ -347,8 +348,10 @@ void DisplayManager::SetLayoutForCurrentDisplays(
// Primary's bounds stay the same. Just notify bounds change
// on the secondary.
- screen_ash_->NotifyBoundsChanged(
- ScreenUtil::GetSecondaryDisplay());
+ int metrics = gfx::DisplayObserver::DISPLAY_METRICS_BOUNDS |
+ gfx::DisplayObserver::DISPLAY_METRICS_WORKAREA;
+ screen_ash_->NotifyMetricsChanged(ScreenUtil::GetSecondaryDisplay(),
+ static_cast<gfx::DisplayObserver::MetricsType>(metrics));
if (delegate_)
delegate_->PostDisplayConfigurationChange();
}
@@ -805,7 +808,11 @@ void DisplayManager::UpdateDisplays(
non_desktop_display_updater.reset();
for (std::vector<size_t>::iterator iter = changed_display_indices.begin();
iter != changed_display_indices.end(); ++iter) {
- screen_ash_->NotifyBoundsChanged(displays_[*iter]);
+ int metrics = gfx::DisplayObserver::DISPLAY_METRICS_BOUNDS |
+ gfx::DisplayObserver::DISPLAY_METRICS_WORKAREA |
+ gfx::DisplayObserver::DISPLAY_METRICS_ROTATION;
oshima 2014/05/08 18:06:50 are you going to change this to notify the correct
mlamouri (slow - plz ping) 2014/05/09 16:11:39 Done. Understanding how the Display objects are ha
+ screen_ash_->NotifyMetricsChanged(displays_[*iter],
+ static_cast<gfx::DisplayObserver::MetricsType>(metrics));
}
if (delegate_)
delegate_->PostDisplayConfigurationChange();
@@ -955,7 +962,8 @@ bool DisplayManager::UpdateDisplayBounds(int64 display_id,
return false;
gfx::Display* display = FindDisplayForId(display_id);
display->SetSize(display_info_[display_id].size_in_pixel());
- screen_ash_->NotifyBoundsChanged(*display);
+ screen_ash_->NotifyMetricsChanged(*display,
+ gfx::DisplayObserver::DISPLAY_METRICS_BOUNDS);
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698