| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/magnifier/magnification_controller.h" | 5 #include "ash/magnifier/magnification_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 origin_.set_x(x); | 202 origin_.set_x(x); |
| 203 origin_.set_y(y); | 203 origin_.set_y(y); |
| 204 scale_ = scale; | 204 scale_ = scale; |
| 205 | 205 |
| 206 // Creates transform matrix. | 206 // Creates transform matrix. |
| 207 gfx::Transform transform; | 207 gfx::Transform transform; |
| 208 // Flips the signs intentionally to convert them from the position of the | 208 // Flips the signs intentionally to convert them from the position of the |
| 209 // magnification window. | 209 // magnification window. |
| 210 transform.ConcatTranslate(-origin_.x(), -origin_.y()); | 210 transform.Scale(scale_, scale_); |
| 211 transform.ConcatScale(scale_, scale_); | 211 transform.Translate(-origin_.x(), -origin_.y()); |
| 212 | 212 |
| 213 ui::ScopedLayerAnimationSettings settings( | 213 ui::ScopedLayerAnimationSettings settings( |
| 214 root_window_->layer()->GetAnimator()); | 214 root_window_->layer()->GetAnimator()); |
| 215 settings.AddObserver(this); | 215 settings.AddObserver(this); |
| 216 settings.SetPreemptionStrategy( | 216 settings.SetPreemptionStrategy( |
| 217 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 217 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
| 218 settings.SetTweenType(ui::Tween::EASE_OUT); | 218 settings.SetTweenType(ui::Tween::EASE_OUT); |
| 219 settings.SetTransitionDuration( | 219 settings.SetTransitionDuration( |
| 220 base::TimeDelta::FromMilliseconds(animate ? 100 : 0)); | 220 base::TimeDelta::FromMilliseconds(animate ? 100 : 0)); |
| 221 | 221 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 504 |
| 505 //////////////////////////////////////////////////////////////////////////////// | 505 //////////////////////////////////////////////////////////////////////////////// |
| 506 // MagnificationController: | 506 // MagnificationController: |
| 507 | 507 |
| 508 // static | 508 // static |
| 509 MagnificationController* MagnificationController::CreateInstance() { | 509 MagnificationController* MagnificationController::CreateInstance() { |
| 510 return new MagnificationControllerImpl(); | 510 return new MagnificationControllerImpl(); |
| 511 } | 511 } |
| 512 | 512 |
| 513 } // namespace ash | 513 } // namespace ash |
| OLD | NEW |