| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 197 } |
| 198 | 198 |
| 199 origin_.set_x(x); | 199 origin_.set_x(x); |
| 200 origin_.set_y(y); | 200 origin_.set_y(y); |
| 201 scale_ = scale; | 201 scale_ = scale; |
| 202 | 202 |
| 203 // Creates transform matrix. | 203 // Creates transform matrix. |
| 204 gfx::Transform transform; | 204 gfx::Transform transform; |
| 205 // Flips the signs intentionally to convert them from the position of the | 205 // Flips the signs intentionally to convert them from the position of the |
| 206 // magnification window. | 206 // magnification window. |
| 207 transform.ConcatTranslate(-origin_.x(), -origin_.y()); | 207 transform.Scale(scale_, scale_); |
| 208 transform.ConcatScale(scale_, scale_); | 208 transform.Translate(-origin_.x(), -origin_.y()); |
| 209 | 209 |
| 210 ui::ScopedLayerAnimationSettings settings( | 210 ui::ScopedLayerAnimationSettings settings( |
| 211 root_window_->layer()->GetAnimator()); | 211 root_window_->layer()->GetAnimator()); |
| 212 settings.AddObserver(this); | 212 settings.AddObserver(this); |
| 213 settings.SetPreemptionStrategy( | 213 settings.SetPreemptionStrategy( |
| 214 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 214 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
| 215 settings.SetTweenType(ui::Tween::EASE_OUT); | 215 settings.SetTweenType(ui::Tween::EASE_OUT); |
| 216 settings.SetTransitionDuration( | 216 settings.SetTransitionDuration( |
| 217 base::TimeDelta::FromMilliseconds(animate ? 100 : 0)); | 217 base::TimeDelta::FromMilliseconds(animate ? 100 : 0)); |
| 218 | 218 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 489 |
| 490 //////////////////////////////////////////////////////////////////////////////// | 490 //////////////////////////////////////////////////////////////////////////////// |
| 491 // MagnificationController: | 491 // MagnificationController: |
| 492 | 492 |
| 493 // static | 493 // static |
| 494 MagnificationController* MagnificationController::CreateInstance() { | 494 MagnificationController* MagnificationController::CreateInstance() { |
| 495 return new MagnificationControllerImpl(); | 495 return new MagnificationControllerImpl(); |
| 496 } | 496 } |
| 497 | 497 |
| 498 } // namespace ash | 498 } // namespace ash |
| OLD | NEW |