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 #ifndef ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ | 5 #ifndef ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ |
6 #define ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ | 6 #define ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 29 matching lines...) Expand all Loading... | |
40 // Switch PartialMagnified RootWindow to |new_root_window|. This does | 40 // Switch PartialMagnified RootWindow to |new_root_window|. This does |
41 // following: | 41 // following: |
42 // - Remove the magnifier from the current root window. | 42 // - Remove the magnifier from the current root window. |
43 // - Create a magnifier in the new root_window |new_root_window|. | 43 // - Create a magnifier in the new root_window |new_root_window|. |
44 // - Switch the target window from current window to |new_root_window|. | 44 // - Switch the target window from current window to |new_root_window|. |
45 void SwitchTargetRootWindowIfNeeded(aura::Window* new_root_window); | 45 void SwitchTargetRootWindowIfNeeded(aura::Window* new_root_window); |
46 | 46 |
47 private: | 47 private: |
48 friend class PartialMagnificationControllerTestApi; | 48 friend class PartialMagnificationControllerTestApi; |
49 | 49 |
50 class BorderRenderer; | |
50 class ContentMask; | 51 class ContentMask; |
51 | 52 |
52 // ui::EventHandler: | 53 // ui::EventHandler: |
53 void OnMouseEvent(ui::MouseEvent* event) override; | 54 void OnMouseEvent(ui::MouseEvent* event) override; |
54 void OnTouchEvent(ui::TouchEvent* event) override; | 55 void OnTouchEvent(ui::TouchEvent* event) override; |
55 | 56 |
56 // WindowObserver: | 57 // WindowObserver: |
57 void OnWindowDestroying(aura::Window* window) override; | 58 void OnWindowDestroying(aura::Window* window) override; |
58 | 59 |
59 // WidgetObserver: | 60 // WidgetObserver: |
(...skipping 17 matching lines...) Expand all Loading... | |
77 bool is_active_ = false; | 78 bool is_active_ = false; |
78 | 79 |
79 // The host widget is the root parent for all of the layers. The widget's | 80 // The host widget is the root parent for all of the layers. The widget's |
80 // location follows the mouse, which causes the layers to also move. | 81 // location follows the mouse, which causes the layers to also move. |
81 views::Widget* host_widget_ = nullptr; | 82 views::Widget* host_widget_ = nullptr; |
82 | 83 |
83 // Draws the background with a zoom filter applied. | 84 // Draws the background with a zoom filter applied. |
84 std::unique_ptr<ui::Layer> zoom_layer_; | 85 std::unique_ptr<ui::Layer> zoom_layer_; |
85 // Draws an outline that is overlayed on top of |zoom_layer_|. | 86 // Draws an outline that is overlayed on top of |zoom_layer_|. |
86 std::unique_ptr<ui::Layer> border_layer_; | 87 std::unique_ptr<ui::Layer> border_layer_; |
88 // Draws a multicolored black/white/black border on top of |border_layer_|. | |
89 std::unique_ptr<BorderRenderer> border_renderer_; | |
James Cook
2016/09/16 01:48:52
optional: Consider documenting that this must be d
sammiequon
2016/09/16 16:33:35
Done.
| |
87 // Masks the content of |zoom_layer_| so that only a circle is magnified. | 90 // Masks the content of |zoom_layer_| so that only a circle is magnified. |
88 std::unique_ptr<ContentMask> zoom_mask_; | 91 std::unique_ptr<ContentMask> zoom_mask_; |
89 // Masks the content of |border_layer_| so that only a circle outline is | 92 // Masks the content of |border_layer_| so that only a circle outline is |
90 // drawn. | 93 // drawn. |
91 std::unique_ptr<ContentMask> border_mask_; | 94 std::unique_ptr<ContentMask> border_mask_; |
92 | 95 |
93 DISALLOW_COPY_AND_ASSIGN(PartialMagnificationController); | 96 DISALLOW_COPY_AND_ASSIGN(PartialMagnificationController); |
94 }; | 97 }; |
95 | 98 |
96 } // namespace ash | 99 } // namespace ash |
97 | 100 |
98 #endif // ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ | 101 #endif // ASH_MAGNIFIER_PARTIAL_MAGNIFICATION_CONTROLLER_H_ |
OLD | NEW |