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 UI_AURA_WINDOW_TREE_HOST_H_ | 5 #ifndef UI_AURA_WINDOW_TREE_HOST_H_ |
6 #define UI_AURA_WINDOW_TREE_HOST_H_ | 6 #define UI_AURA_WINDOW_TREE_HOST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // Moves the cursor to the specified location relative to the root window. | 126 // Moves the cursor to the specified location relative to the root window. |
127 void MoveCursorToLocationInDIP(const gfx::Point& location_in_dip); | 127 void MoveCursorToLocationInDIP(const gfx::Point& location_in_dip); |
128 | 128 |
129 // Moves the cursor to the |location_in_pixels| given in host coordinates. | 129 // Moves the cursor to the |location_in_pixels| given in host coordinates. |
130 void MoveCursorToLocationInPixels(const gfx::Point& location_in_pixels); | 130 void MoveCursorToLocationInPixels(const gfx::Point& location_in_pixels); |
131 | 131 |
132 gfx::NativeCursor last_cursor() const { return last_cursor_; } | 132 gfx::NativeCursor last_cursor() const { return last_cursor_; } |
133 | 133 |
134 // Gets the InputMethod instance, if NULL, creates & owns it. | 134 // Gets the InputMethod instance, if NULL, creates & owns it. |
135 ui::InputMethod* GetInputMethod(); | 135 ui::InputMethod* GetInputMethod(); |
| 136 bool has_input_method() const { return input_method_ != nullptr; } |
136 | 137 |
137 // Sets a shared unowned InputMethod. This is used when there is a singleton | 138 // Sets a shared unowned InputMethod. This is used when there is a singleton |
138 // InputMethod shared between multiple WindowTreeHost instances. | 139 // InputMethod shared between multiple WindowTreeHost instances. |
139 // | 140 // |
140 // This is used for Ash only. There are 2 reasons: | 141 // This is used for Ash only. There are 2 reasons: |
141 // 1) ChromeOS virtual keyboard needs to receive ShowImeIfNeeded notification | 142 // 1) ChromeOS virtual keyboard needs to receive ShowImeIfNeeded notification |
142 // from InputMethod. Multiple InputMethod instances makes it hard to | 143 // from InputMethod. Multiple InputMethod instances makes it hard to |
143 // register/unregister the observer for that notification. | 144 // register/unregister the observer for that notification. |
144 // 2) For Ozone, there is no native focus state for the root window and | 145 // 2) For Ozone, there is no native focus state for the root window and |
145 // WindowTreeHost. See DrmWindowHost::CanDispatchEvent, the key events always | 146 // WindowTreeHost. See DrmWindowHost::CanDispatchEvent, the key events always |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 bool owned_input_method_; | 266 bool owned_input_method_; |
266 | 267 |
267 gfx::Insets output_surface_padding_in_pixels_; | 268 gfx::Insets output_surface_padding_in_pixels_; |
268 | 269 |
269 DISALLOW_COPY_AND_ASSIGN(WindowTreeHost); | 270 DISALLOW_COPY_AND_ASSIGN(WindowTreeHost); |
270 }; | 271 }; |
271 | 272 |
272 } // namespace aura | 273 } // namespace aura |
273 | 274 |
274 #endif // UI_AURA_WINDOW_TREE_HOST_H_ | 275 #endif // UI_AURA_WINDOW_TREE_HOST_H_ |
OLD | NEW |