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 "ui/aura/client/cursor_client.h" | 22 #include "ui/aura/client/cursor_client.h" |
24 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
25 #include "ui/aura/window_tree_host.h" | 24 #include "ui/aura/window_tree_host.h" |
26 #include "ui/base/ime/input_method.h" | 25 #include "ui/base/ime/input_method.h" |
27 #include "ui/base/ime/input_method_observer.h" | 26 #include "ui/base/ime/input_method_observer.h" |
28 #include "ui/base/ime/text_input_client.h" | 27 #include "ui/base/ime/text_input_client.h" |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 const gfx::Rect& node_bounds_in_screen) { | 430 const gfx::Rect& node_bounds_in_screen) { |
432 // The editable node is handled by OnCaretBoundsChanged. | 431 // The editable node is handled by OnCaretBoundsChanged. |
433 if (is_editable_node) | 432 if (is_editable_node) |
434 return; | 433 return; |
435 | 434 |
436 // Nothing to recenter on. | 435 // Nothing to recenter on. |
437 if (node_bounds_in_screen.IsEmpty()) | 436 if (node_bounds_in_screen.IsEmpty()) |
438 return; | 437 return; |
439 | 438 |
440 gfx::Rect node_bounds_in_root = | 439 gfx::Rect node_bounds_in_root = |
441 ScreenUtil::ConvertRectFromScreen(root_window_, node_bounds_in_screen); | 440 ::wm::ConvertRectFromScreen(root_window_, node_bounds_in_screen); |
442 if (GetViewportRect().Contains(node_bounds_in_root)) | 441 if (GetViewportRect().Contains(node_bounds_in_root)) |
443 return; | 442 return; |
444 | 443 |
445 MoveMagnifierWindowFollowRect(node_bounds_in_root); | 444 MoveMagnifierWindowFollowRect(node_bounds_in_root); |
446 } | 445 } |
447 | 446 |
448 void MagnificationControllerImpl::SwitchTargetRootWindow( | 447 void MagnificationControllerImpl::SwitchTargetRootWindow( |
449 aura::Window* new_root_window, | 448 aura::Window* new_root_window, |
450 bool redraw_original_root_window) { | 449 bool redraw_original_root_window) { |
451 DCHECK(new_root_window); | 450 DCHECK(new_root_window); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 | 856 |
858 //////////////////////////////////////////////////////////////////////////////// | 857 //////////////////////////////////////////////////////////////////////////////// |
859 // MagnificationController: | 858 // MagnificationController: |
860 | 859 |
861 // static | 860 // static |
862 MagnificationController* MagnificationController::CreateInstance() { | 861 MagnificationController* MagnificationController::CreateInstance() { |
863 return new MagnificationControllerImpl(); | 862 return new MagnificationControllerImpl(); |
864 } | 863 } |
865 | 864 |
866 } // namespace ash | 865 } // namespace ash |
OLD | NEW |