| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/accelerators/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "ui/aura/client/cursor_client.h" | 23 #include "ui/aura/client/cursor_client.h" |
| 24 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
| 25 #include "ui/aura/window_tree_host.h" | 25 #include "ui/aura/window_tree_host.h" |
| 26 #include "ui/base/ime/input_method.h" | 26 #include "ui/base/ime/input_method.h" |
| 27 #include "ui/base/ime/input_method_observer.h" | 27 #include "ui/base/ime/input_method_observer.h" |
| 28 #include "ui/base/ime/text_input_client.h" | 28 #include "ui/base/ime/text_input_client.h" |
| 29 #include "ui/compositor/dip_util.h" | 29 #include "ui/compositor/dip_util.h" |
| 30 #include "ui/compositor/layer.h" | 30 #include "ui/compositor/layer.h" |
| 31 #include "ui/compositor/layer_animation_observer.h" | 31 #include "ui/compositor/layer_animation_observer.h" |
| 32 #include "ui/compositor/scoped_layer_animation_settings.h" | 32 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 33 #include "ui/display/screen.h" |
| 33 #include "ui/events/event.h" | 34 #include "ui/events/event.h" |
| 34 #include "ui/events/event_handler.h" | 35 #include "ui/events/event_handler.h" |
| 35 #include "ui/gfx/geometry/point3_f.h" | 36 #include "ui/gfx/geometry/point3_f.h" |
| 36 #include "ui/gfx/geometry/point_conversions.h" | 37 #include "ui/gfx/geometry/point_conversions.h" |
| 37 #include "ui/gfx/geometry/point_f.h" | 38 #include "ui/gfx/geometry/point_f.h" |
| 38 #include "ui/gfx/geometry/rect_conversions.h" | 39 #include "ui/gfx/geometry/rect_conversions.h" |
| 39 #include "ui/gfx/screen.h" | |
| 40 #include "ui/wm/core/compound_event_filter.h" | 40 #include "ui/wm/core/compound_event_filter.h" |
| 41 #include "ui/wm/core/coordinate_conversion.h" | 41 #include "ui/wm/core/coordinate_conversion.h" |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 const float kMaxMagnifiedScale = 4.0f; | 45 const float kMaxMagnifiedScale = 4.0f; |
| 46 const float kMaxMagnifiedScaleThreshold = 4.0f; | 46 const float kMaxMagnifiedScaleThreshold = 4.0f; |
| 47 const float kMinMagnifiedScaleThreshold = 1.1f; | 47 const float kMinMagnifiedScaleThreshold = 1.1f; |
| 48 const float kNonMagnifiedScale = 1.0f; | 48 const float kNonMagnifiedScale = 1.0f; |
| 49 | 49 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 365 |
| 366 ui::ScopedLayerAnimationSettings settings( | 366 ui::ScopedLayerAnimationSettings settings( |
| 367 root_window_->layer()->GetAnimator()); | 367 root_window_->layer()->GetAnimator()); |
| 368 settings.AddObserver(this); | 368 settings.AddObserver(this); |
| 369 settings.SetPreemptionStrategy( | 369 settings.SetPreemptionStrategy( |
| 370 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 370 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
| 371 settings.SetTweenType(tween_type); | 371 settings.SetTweenType(tween_type); |
| 372 settings.SetTransitionDuration( | 372 settings.SetTransitionDuration( |
| 373 base::TimeDelta::FromMilliseconds(duration_in_ms)); | 373 base::TimeDelta::FromMilliseconds(duration_in_ms)); |
| 374 | 374 |
| 375 gfx::Display display = | 375 display::Display display = |
| 376 gfx::Screen::GetScreen()->GetDisplayNearestWindow(root_window_); | 376 display::Screen::GetScreen()->GetDisplayNearestWindow(root_window_); |
| 377 std::unique_ptr<RootWindowTransformer> transformer( | 377 std::unique_ptr<RootWindowTransformer> transformer( |
| 378 CreateRootWindowTransformerForDisplay(root_window_, display)); | 378 CreateRootWindowTransformerForDisplay(root_window_, display)); |
| 379 GetRootWindowController(root_window_) | 379 GetRootWindowController(root_window_) |
| 380 ->ash_host() | 380 ->ash_host() |
| 381 ->SetRootWindowTransformer(std::move(transformer)); | 381 ->SetRootWindowTransformer(std::move(transformer)); |
| 382 | 382 |
| 383 if (duration_in_ms > 0) | 383 if (duration_in_ms > 0) |
| 384 is_on_animation_ = true; | 384 is_on_animation_ = true; |
| 385 | 385 |
| 386 return true; | 386 return true; |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 | 854 |
| 855 //////////////////////////////////////////////////////////////////////////////// | 855 //////////////////////////////////////////////////////////////////////////////// |
| 856 // MagnificationController: | 856 // MagnificationController: |
| 857 | 857 |
| 858 // static | 858 // static |
| 859 MagnificationController* MagnificationController::CreateInstance() { | 859 MagnificationController* MagnificationController::CreateInstance() { |
| 860 return new MagnificationControllerImpl(); | 860 return new MagnificationControllerImpl(); |
| 861 } | 861 } |
| 862 | 862 |
| 863 } // namespace ash | 863 } // namespace ash |
| OLD | NEW |