| 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/common/accelerators/accelerator_controller.h" | 10 #include "ash/common/accelerators/accelerator_controller.h" |
| 11 #include "ash/common/accessibility_delegate.h" | 11 #include "ash/common/accessibility_delegate.h" |
| 12 #include "ash/common/system/tray/system_tray_delegate.h" | 12 #include "ash/common/system/tray/system_tray_delegate.h" |
| 13 #include "ash/common/wm_shell.h" | 13 #include "ash/common/wm_shell.h" |
| 14 #include "ash/display/root_window_transformers.h" | 14 #include "ash/display/root_window_transformers.h" |
| 15 #include "ash/host/ash_window_tree_host.h" | 15 #include "ash/host/ash_window_tree_host.h" |
| 16 #include "ash/host/root_window_transformer.h" | 16 #include "ash/host/root_window_transformer.h" |
| 17 #include "ash/root_window_controller.h" | 17 #include "ash/root_window_controller.h" |
| 18 #include "ash/screen_util.h" | |
| 19 #include "ash/shell.h" | 18 #include "ash/shell.h" |
| 20 #include "base/command_line.h" | 19 #include "base/command_line.h" |
| 21 #include "base/synchronization/waitable_event.h" | 20 #include "base/synchronization/waitable_event.h" |
| 22 #include "base/timer/timer.h" | 21 #include "base/timer/timer.h" |
| 23 #include "chromeos/chromeos_switches.h" | 22 #include "chromeos/chromeos_switches.h" |
| 24 #include "ui/aura/client/cursor_client.h" | 23 #include "ui/aura/client/cursor_client.h" |
| 25 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
| 26 #include "ui/aura/window_tree_host.h" | 25 #include "ui/aura/window_tree_host.h" |
| 27 #include "ui/base/ime/input_method.h" | 26 #include "ui/base/ime/input_method.h" |
| 28 #include "ui/base/ime/input_method_observer.h" | 27 #include "ui/base/ime/input_method_observer.h" |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 bool is_editable_node, | 432 bool is_editable_node, |
| 434 const gfx::Rect& node_bounds_in_screen) { | 433 const gfx::Rect& node_bounds_in_screen) { |
| 435 // The editable node is handled by OnCaretBoundsChanged. | 434 // The editable node is handled by OnCaretBoundsChanged. |
| 436 if (is_editable_node) | 435 if (is_editable_node) |
| 437 return; | 436 return; |
| 438 | 437 |
| 439 // Nothing to recenter on. | 438 // Nothing to recenter on. |
| 440 if (node_bounds_in_screen.IsEmpty()) | 439 if (node_bounds_in_screen.IsEmpty()) |
| 441 return; | 440 return; |
| 442 | 441 |
| 443 gfx::Rect node_bounds_in_root = | 442 gfx::Rect node_bounds_in_root = node_bounds_in_screen; |
| 444 ScreenUtil::ConvertRectFromScreen(root_window_, node_bounds_in_screen); | 443 ::wm::ConvertRectFromScreen(root_window_, &node_bounds_in_root); |
| 445 if (GetViewportRect().Contains(node_bounds_in_root)) | 444 if (GetViewportRect().Contains(node_bounds_in_root)) |
| 446 return; | 445 return; |
| 447 | 446 |
| 448 MoveMagnifierWindowFollowRect(node_bounds_in_root); | 447 MoveMagnifierWindowFollowRect(node_bounds_in_root); |
| 449 } | 448 } |
| 450 | 449 |
| 451 void MagnificationControllerImpl::SwitchTargetRootWindow( | 450 void MagnificationControllerImpl::SwitchTargetRootWindow( |
| 452 aura::Window* new_root_window, | 451 aura::Window* new_root_window, |
| 453 bool redraw_original_root_window) { | 452 bool redraw_original_root_window) { |
| 454 DCHECK(new_root_window); | 453 DCHECK(new_root_window); |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 | 886 |
| 888 //////////////////////////////////////////////////////////////////////////////// | 887 //////////////////////////////////////////////////////////////////////////////// |
| 889 // MagnificationController: | 888 // MagnificationController: |
| 890 | 889 |
| 891 // static | 890 // static |
| 892 MagnificationController* MagnificationController::CreateInstance() { | 891 MagnificationController* MagnificationController::CreateInstance() { |
| 893 return new MagnificationControllerImpl(); | 892 return new MagnificationControllerImpl(); |
| 894 } | 893 } |
| 895 | 894 |
| 896 } // namespace ash | 895 } // namespace ash |
| OLD | NEW |