| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/host/transformer_helper.h" | 5 #include "ash/host/transformer_helper.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/host/ash_window_tree_host.h" | 9 #include "ash/host/ash_window_tree_host.h" |
| 10 #include "ash/host/root_window_transformer.h" | 10 #include "ash/host/root_window_transformer.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 const aura::Window* root_window_; | 53 const aura::Window* root_window_; |
| 54 const gfx::Transform transform_; | 54 const gfx::Transform transform_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(SimpleRootWindowTransformer); | 56 DISALLOW_COPY_AND_ASSIGN(SimpleRootWindowTransformer); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace | 59 } // namespace |
| 60 | 60 |
| 61 TransformerHelper::TransformerHelper(AshWindowTreeHost* ash_host) | 61 TransformerHelper::TransformerHelper(AshWindowTreeHost* ash_host) |
| 62 : ash_host_(ash_host) { | 62 : ash_host_(ash_host) {} |
| 63 } | |
| 64 | 63 |
| 65 TransformerHelper::~TransformerHelper() {} | 64 TransformerHelper::~TransformerHelper() {} |
| 66 | 65 |
| 67 void TransformerHelper::Init() { | 66 void TransformerHelper::Init() { |
| 68 SetTransform(gfx::Transform()); | 67 SetTransform(gfx::Transform()); |
| 69 } | 68 } |
| 70 | 69 |
| 71 gfx::Insets TransformerHelper::GetHostInsets() const { | 70 gfx::Insets TransformerHelper::GetHostInsets() const { |
| 72 return transformer_->GetHostInsets(); | 71 return transformer_->GetHostInsets(); |
| 73 } | 72 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 transform.Scale(1.0f / scale, 1.0f / scale); | 106 transform.Scale(1.0f / scale, 1.0f / scale); |
| 108 return transformer_->GetInverseTransform() * transform; | 107 return transformer_->GetInverseTransform() * transform; |
| 109 } | 108 } |
| 110 | 109 |
| 111 void TransformerHelper::UpdateWindowSize(const gfx::Size& host_size) { | 110 void TransformerHelper::UpdateWindowSize(const gfx::Size& host_size) { |
| 112 ash_host_->AsWindowTreeHost()->window()->SetBounds( | 111 ash_host_->AsWindowTreeHost()->window()->SetBounds( |
| 113 transformer_->GetRootWindowBounds(host_size)); | 112 transformer_->GetRootWindowBounds(host_size)); |
| 114 } | 113 } |
| 115 | 114 |
| 116 } // namespace ash | 115 } // namespace ash |
| OLD | NEW |