| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/aura/window_tree_host.h" | 5 #include "ui/aura/window_tree_host.h" |
| 6 | 6 |
| 7 #include "base/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "ui/aura/client/capture_client.h" | 9 #include "ui/aura/client/capture_client.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 "origin", new_location.ToString()); | 266 "origin", new_location.ToString()); |
| 267 | 267 |
| 268 FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_, | 268 FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_, |
| 269 OnHostMoved(this, new_location)); | 269 OnHostMoved(this, new_location)); |
| 270 } | 270 } |
| 271 | 271 |
| 272 void WindowTreeHost::OnHostResized(const gfx::Size& new_size) { | 272 void WindowTreeHost::OnHostResized(const gfx::Size& new_size) { |
| 273 gfx::Size adjusted_size(new_size); | 273 gfx::Size adjusted_size(new_size); |
| 274 adjusted_size.Enlarge(output_surface_padding_.width(), | 274 adjusted_size.Enlarge(output_surface_padding_.width(), |
| 275 output_surface_padding_.height()); | 275 output_surface_padding_.height()); |
| 276 display::Display display = |
| 277 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 278 |
| 279 LOG(ERROR) << "OnHostResized called:" << new_size.ToString() |
| 280 << ", display=" << display.ToString(); |
| 281 |
| 276 // The compositor should have the same size as the native root window host. | 282 // The compositor should have the same size as the native root window host. |
| 277 // Get the latest scale from display because it might have been changed. | 283 // Get the latest scale from display because it might have been changed. |
| 278 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), | 284 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), |
| 279 adjusted_size); | 285 adjusted_size); |
| 280 | 286 |
| 281 gfx::Size layer_size = GetBounds().size(); | 287 gfx::Size layer_size = GetBounds().size(); |
| 282 // The layer, and the observers should be notified of the | 288 // The layer, and the observers should be notified of the |
| 283 // transformed size of the root window. | 289 // transformed size of the root window. |
| 284 UpdateRootWindowSize(layer_size); | 290 UpdateRootWindowSize(layer_size); |
| 285 FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_, OnHostResized(this)); | 291 FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_, OnHostResized(this)); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 client::CursorClient* cursor_client = client::GetCursorClient(window()); | 325 client::CursorClient* cursor_client = client::GetCursorClient(window()); |
| 320 if (cursor_client) { | 326 if (cursor_client) { |
| 321 const display::Display& display = | 327 const display::Display& display = |
| 322 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); | 328 display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| 323 cursor_client->SetDisplay(display); | 329 cursor_client->SetDisplay(display); |
| 324 } | 330 } |
| 325 dispatcher()->OnCursorMovedToRootLocation(root_location); | 331 dispatcher()->OnCursorMovedToRootLocation(root_location); |
| 326 } | 332 } |
| 327 | 333 |
| 328 } // namespace aura | 334 } // namespace aura |
| OLD | NEW |