| Index: ash/display/display_controller.cc
|
| diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
|
| index c8cad9e5eefd300a41947a2541f2d0ad2a8d5e8f..6f129c5bd682fd7a9fc69322257382605f787933 100644
|
| --- a/ash/display/display_controller.cc
|
| +++ b/ash/display/display_controller.cc
|
| @@ -543,15 +543,6 @@ bool DisplayController::UpdateWorkAreaOfDisplayNearestWindow(
|
| return GetDisplayManager()->UpdateWorkAreaOfDisplay(id, insets);
|
| }
|
|
|
| -void DisplayController::OnDisplayBoundsChanged(const gfx::Display& display) {
|
| - const DisplayInfo& display_info =
|
| - GetDisplayManager()->GetDisplayInfo(display.id());
|
| - DCHECK(!display_info.bounds_in_native().IsEmpty());
|
| - AshWindowTreeHost* ash_host = window_tree_hosts_[display.id()];
|
| - ash_host->AsWindowTreeHost()->SetBounds(display_info.bounds_in_native());
|
| - SetDisplayPropertiesOnHost(ash_host, display);
|
| -}
|
| -
|
| void DisplayController::OnDisplayAdded(const gfx::Display& display) {
|
| if (primary_tree_host_for_replace_) {
|
| DCHECK(window_tree_hosts_.empty());
|
| @@ -605,8 +596,9 @@ void DisplayController::OnDisplayRemoved(const gfx::Display& display) {
|
| GetRootWindowSettings(GetWindow(primary_host))->display_id =
|
| primary_display_id;
|
|
|
| - OnDisplayBoundsChanged(
|
| - GetDisplayManager()->GetDisplayForId(primary_display_id));
|
| + OnDisplayMetricsChanged(
|
| + GetDisplayManager()->GetDisplayForId(primary_display_id),
|
| + DISPLAY_METRICS_BOUNDS);
|
| }
|
| RootWindowController* controller =
|
| GetRootWindowController(GetWindow(host_to_delete));
|
| @@ -618,6 +610,20 @@ void DisplayController::OnDisplayRemoved(const gfx::Display& display) {
|
| base::MessageLoop::current()->DeleteSoon(FROM_HERE, controller);
|
| }
|
|
|
| +void DisplayController::OnDisplayMetricsChanged(const gfx::Display& display,
|
| + DisplayObserver::DisplayMetrics metrics) {
|
| + if (!(metrics & (DISPLAY_METRICS_BOUNDS | DISPLAY_METRICS_ROTATION |
|
| + DISPLAY_METRICS_DEVICE_SCALE_FACTOR)))
|
| + return;
|
| +
|
| + const DisplayInfo& display_info =
|
| + GetDisplayManager()->GetDisplayInfo(display.id());
|
| + DCHECK(!display_info.bounds_in_native().IsEmpty());
|
| + AshWindowTreeHost* ash_host = window_tree_hosts_[display.id()];
|
| + ash_host->AsWindowTreeHost()->SetBounds(display_info.bounds_in_native());
|
| + SetDisplayPropertiesOnHost(ash_host, display);
|
| +}
|
| +
|
| void DisplayController::OnHostResized(const aura::WindowTreeHost* host) {
|
| gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow(
|
| const_cast<aura::Window*>(host->window()));
|
|
|