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/display/root_window_transformers.h" | 7 #include "ash/display/root_window_transformers.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // Flips the signs intentionally to convert them from the position of the | 258 // Flips the signs intentionally to convert them from the position of the |
259 // magnification window. | 259 // magnification window. |
260 transform.Scale(scale_, scale_); | 260 transform.Scale(scale_, scale_); |
261 transform.Translate(-origin_.x(), -origin_.y()); | 261 transform.Translate(-origin_.x(), -origin_.y()); |
262 | 262 |
263 ui::ScopedLayerAnimationSettings settings( | 263 ui::ScopedLayerAnimationSettings settings( |
264 root_window_->layer()->GetAnimator()); | 264 root_window_->layer()->GetAnimator()); |
265 settings.AddObserver(this); | 265 settings.AddObserver(this); |
266 settings.SetPreemptionStrategy( | 266 settings.SetPreemptionStrategy( |
267 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 267 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
268 settings.SetTweenType(ui::Tween::EASE_OUT); | 268 settings.SetTweenType(gfx::Tween::EASE_OUT); |
269 settings.SetTransitionDuration( | 269 settings.SetTransitionDuration( |
270 base::TimeDelta::FromMilliseconds(animate ? 100 : 0)); | 270 base::TimeDelta::FromMilliseconds(animate ? 100 : 0)); |
271 | 271 |
272 gfx::Display display = | 272 gfx::Display display = |
273 Shell::GetScreen()->GetDisplayNearestWindow(root_window_); | 273 Shell::GetScreen()->GetDisplayNearestWindow(root_window_); |
274 scoped_ptr<aura::RootWindowTransformer> transformer( | 274 scoped_ptr<aura::RootWindowTransformer> transformer( |
275 internal::CreateRootWindowTransformerForDisplay(root_window_, display)); | 275 internal::CreateRootWindowTransformerForDisplay(root_window_, display)); |
276 root_window_->SetRootWindowTransformer(transformer.Pass()); | 276 root_window_->SetRootWindowTransformer(transformer.Pass()); |
277 | 277 |
278 if (animate) | 278 if (animate) |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 622 |
623 //////////////////////////////////////////////////////////////////////////////// | 623 //////////////////////////////////////////////////////////////////////////////// |
624 // MagnificationController: | 624 // MagnificationController: |
625 | 625 |
626 // static | 626 // static |
627 MagnificationController* MagnificationController::CreateInstance() { | 627 MagnificationController* MagnificationController::CreateInstance() { |
628 return new MagnificationControllerImpl(); | 628 return new MagnificationControllerImpl(); |
629 } | 629 } |
630 | 630 |
631 } // namespace ash | 631 } // namespace ash |
OLD | NEW |