Chromium Code Reviews| Index: ash/magnifier/magnification_controller.cc |
| diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc |
| index 68386a9ed934a970f303c5901d855c3b48cc91f0..a6ad0a1a1ad601877d8aa578781503fb3acfbffa 100644 |
| --- a/ash/magnifier/magnification_controller.cc |
| +++ b/ash/magnifier/magnification_controller.cc |
| @@ -93,6 +93,8 @@ class MagnificationControllerImpl : virtual public MagnificationController, |
| void HandleFocusedNodeChanged( |
| bool is_editable_node, |
| const gfx::Rect& node_bounds_in_screen) override; |
| + void SwitchTargetRootWindow(aura::Window* new_root_window, |
| + bool redraw_original_root_window) override; |
| // For test |
| gfx::Point GetPointOfInterestForTesting() override { |
| @@ -137,13 +139,6 @@ class MagnificationControllerImpl : virtual public MagnificationController, |
| // started. |
| void AfterAnimationMoveCursorTo(const gfx::Point& location); |
| - // Switch Magnified RootWindow to |new_root_window|. This does following: |
| - // - Unzoom the current root_window. |
| - // - Zoom the given new root_window |new_root_window|. |
| - // - Switch the target window from current window to |new_root_window|. |
| - void SwitchTargetRootWindow(aura::Window* new_root_window, |
| - bool redraw_original_root_window); |
| - |
| // Returns if the magnification scale is 1.0 or not (larger then 1.0). |
| bool IsMagnified() const; |
| @@ -387,6 +382,26 @@ void MagnificationControllerImpl::HandleFocusedNodeChanged( |
| MoveMagnifierWindowFollowRect(node_bounds_in_root); |
| } |
| +void MagnificationControllerImpl::SwitchTargetRootWindow( |
| + aura::Window* new_root_window, |
|
Jun Mukai
2015/05/01 22:06:07
This is named as |window| in the header file.
oshima
2015/05/01 22:44:57
updated the header
|
| + bool redraw_original_root_window) { |
| + DCHECK(new_root_window); |
| + |
| + if (new_root_window == root_window_) |
| + return; |
| + |
| + // Stores the previous scale. |
| + float scale = GetScale(); |
| + |
| + // Unmagnify the previous root window. |
| + root_window_->RemoveObserver(this); |
| + if (redraw_original_root_window) |
| + RedrawKeepingMousePosition(1.0f, true); |
| + root_window_ = new_root_window; |
| + RedrawKeepingMousePosition(scale, true); |
| + root_window_->AddObserver(this); |
| +} |
| + |
| void MagnificationControllerImpl::AfterAnimationMoveCursorTo( |
| const gfx::Point& location) { |
| DCHECK(root_window_); |
| @@ -478,27 +493,6 @@ void MagnificationControllerImpl::OnWindowBoundsChanged( |
| // TODO(yoshiki): implement here. crbug.com/230979 |
| } |
| -void MagnificationControllerImpl::SwitchTargetRootWindow( |
| - aura::Window* new_root_window, |
| - bool redraw_original_root_window) { |
| - DCHECK(new_root_window); |
| - |
| - if (new_root_window == root_window_) |
| - return; |
| - |
| - // Stores the previous scale. |
| - float scale = GetScale(); |
| - |
| - // Unmagnify the previous root window. |
| - root_window_->RemoveObserver(this); |
| - if (redraw_original_root_window) |
| - RedrawKeepingMousePosition(1.0f, true); |
| - |
| - root_window_ = new_root_window; |
| - RedrawKeepingMousePosition(scale, true); |
| - root_window_->AddObserver(this); |
| -} |
| - |
| //////////////////////////////////////////////////////////////////////////////// |
| // MagnificationControllerImpl: MagnificationController implementation |