| 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 "ui/aura/env.h" | 7 #include "ui/aura/env.h" |
| 8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
| 9 #include "ui/aura/root_window_transformer.h" | 9 #include "ui/aura/root_window_transformer.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 compositor_.reset(new ui::Compositor(GetAcceleratedWidget())); | 174 compositor_.reset(new ui::Compositor(GetAcceleratedWidget())); |
| 175 DCHECK(compositor_.get()); | 175 DCHECK(compositor_.get()); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void WindowTreeHost::NotifyHostResized(const gfx::Size& new_size) { | 178 void WindowTreeHost::NotifyHostResized(const gfx::Size& new_size) { |
| 179 // The compositor should have the same size as the native root window host. | 179 // The compositor should have the same size as the native root window host. |
| 180 // Get the latest scale from display because it might have been changed. | 180 // Get the latest scale from display because it might have been changed. |
| 181 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), | 181 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), |
| 182 new_size); | 182 new_size); |
| 183 | 183 |
| 184 gfx::Size layer_size = GetBounds().size(); |
| 184 // The layer, and the observers should be notified of the | 185 // The layer, and the observers should be notified of the |
| 185 // transformed size of the root window. | 186 // transformed size of the root window. |
| 186 UpdateRootWindowSize(new_size); | 187 UpdateRootWindowSize(layer_size); |
| 187 delegate_->OnHostResized(new_size); | 188 delegate_->OnHostResized(layer_size); |
| 188 } | 189 } |
| 189 | 190 |
| 190 #if defined(OS_ANDROID) | 191 #if defined(OS_ANDROID) |
| 191 // static | 192 // static |
| 192 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { | 193 WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { |
| 193 // This is only hit for tests and ash, right now these aren't an issue so | 194 // This is only hit for tests and ash, right now these aren't an issue so |
| 194 // adding the CHECK. | 195 // adding the CHECK. |
| 195 // TODO(sky): decide if we want a factory. | 196 // TODO(sky): decide if we want a factory. |
| 196 CHECK(false); | 197 CHECK(false); |
| 197 return NULL; | 198 return NULL; |
| 198 } | 199 } |
| 199 #endif | 200 #endif |
| 200 | 201 |
| 201 } // namespace aura | 202 } // namespace aura |
| OLD | NEW |