blob: 50b18cacf0eaea118f77fc371c31e657a256c690 [file] [log] [blame]
[email protected]5922cb22012-01-17 21:53:121// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]81585f32011-07-29 19:32:062// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]e8cf7332014-02-14 18:54:585#ifndef UI_AURA_WINDOW_TREE_HOST_H_
6#define UI_AURA_WINDOW_TREE_HOST_H_
[email protected]81585f32011-07-29 19:32:067
Scott Violet2784cad2017-12-05 20:39:268#include <stdint.h>
9
sky631094cd2016-10-26 18:21:0110#include <memory>
Gary Kacmarcik9c79e1fe2018-05-15 15:57:2011#include <string>
[email protected]1266ba492012-05-16 23:29:4812
Gary Kacmarcik9c79e1fe2018-05-15 15:57:2013#include "base/containers/flat_map.h"
Joe Downinga8e74ac2018-02-26 17:10:2414#include "base/containers/flat_set.h"
avi4ca294112015-12-24 08:04:0915#include "base/macros.h"
Joe Downinga8e74ac2018-02-26 17:10:2416#include "base/memory/weak_ptr.h"
Gabriel Charettea92b7632018-05-01 19:20:3217#include "base/observer_list.h"
Joe Downinga8e74ac2018-02-26 17:10:2418#include "base/optional.h"
jonross180dc482018-10-23 21:22:0919#include "base/time/time.h"
Fady Samuel644df1d2017-07-13 01:13:0220#include "components/viz/common/surfaces/frame_sink_id.h"
Sadrul Habib Chowdhury3c7fdca2018-04-18 05:08:4021#include "components/viz/common/surfaces/local_surface_id.h"
[email protected]252f86be2012-09-27 20:35:0322#include "ui/aura/aura_export.h"
Scott Violet36529162018-08-09 05:09:3223#include "ui/aura/window.h"
[email protected]c7839552012-04-03 21:14:3624#include "ui/base/cursor/cursor.h"
shuchen29f3c7a2015-06-10 07:48:2825#include "ui/base/ime/input_method_delegate.h"
Fady Samueld7625cc02017-10-13 05:25:1826#include "ui/compositor/compositor_observer.h"
Christopher Cameron1f3a4e3e2017-07-18 06:16:0127#include "ui/display/display_observer.h"
[email protected]8ecd5fa2014-04-24 23:04:0328#include "ui/events/event_source.h"
Scott Violetc730d60a2018-03-22 17:45:0629#include "ui/events/platform_event.h"
[email protected]81585f32011-07-29 19:32:0630#include "ui/gfx/native_widget_types.h"
31
32namespace gfx {
[email protected]896728e2011-10-14 00:41:2633class Point;
[email protected]81585f32011-07-29 19:32:0634class Rect;
35class Size;
[email protected]0a04ef12013-12-19 20:15:4036class Transform;
37}
38
39namespace ui {
40class Compositor;
Joe Downingf18d97c2018-05-03 04:41:4441enum class DomCode;
penghuang17134c6c2017-03-23 00:01:0742class EventSink;
shuchen29f3c7a2015-06-10 07:48:2843class InputMethod;
[email protected]2374d1812014-03-04 03:42:2744class ViewProp;
Sergey Ulanov528cf76e2018-06-20 22:49:0845struct PlatformWindowInitProperties;
[email protected]81585f32011-07-29 19:32:0646}
47
48namespace aura {
Joe Downinga8e74ac2018-02-26 17:10:2449
[email protected]dc645d52014-04-28 14:42:5550namespace test {
51class WindowTreeHostTestApi;
52}
53
Xiyuan Xia82ceeef2018-09-14 20:50:5054class Env;
55class ScopedKeyboardHook;
[email protected]056ce052014-02-21 05:19:3256class WindowEventDispatcher;
[email protected]2d6eb742014-03-05 18:59:0357class WindowTreeHostObserver;
[email protected]81585f32011-07-29 19:32:0658
[email protected]641dcfd2014-01-08 16:41:2359// WindowTreeHost bridges between a native window and the embedded RootWindow.
[email protected]99f07e02011-12-07 00:02:5960// It provides the accelerated widget and maps events from the native os to
61// aura.
shuchen29f3c7a2015-06-10 07:48:2862class AURA_EXPORT WindowTreeHost : public ui::internal::InputMethodDelegate,
Christopher Cameron1f3a4e3e2017-07-18 06:16:0163 public ui::EventSource,
Fady Samueld7625cc02017-10-13 05:25:1864 public display::DisplayObserver,
65 public ui::CompositorObserver {
[email protected]81585f32011-07-29 19:32:0666 public:
shuchen29f3c7a2015-06-10 07:48:2867 ~WindowTreeHost() override;
[email protected]81585f32011-07-29 19:32:0668
Xiyuan Xia82ceeef2018-09-14 20:50:5069 // Creates a new WindowTreeHost with the specified |properties| and an
70 // optional |env|. If |env| is null, the default Env::GetInstance() is used.
Sergey Ulanov528cf76e2018-06-20 22:49:0871 static std::unique_ptr<WindowTreeHost> Create(
Xiyuan Xia82ceeef2018-09-14 20:50:5072 ui::PlatformWindowInitProperties properties,
73 Env* env = nullptr);
[email protected]81585f32011-07-29 19:32:0674
[email protected]2374d1812014-03-04 03:42:2775 // Returns the WindowTreeHost for the specified accelerated widget, or NULL
76 // if there is none associated.
77 static WindowTreeHost* GetForAcceleratedWidget(gfx::AcceleratedWidget widget);
78
[email protected]0a04ef12013-12-19 20:15:4079 void InitHost();
80
[email protected]a06955222014-03-10 22:47:3281 void AddObserver(WindowTreeHostObserver* observer);
82 void RemoveObserver(WindowTreeHostObserver* observer);
David Bienvenud0ddda32018-11-01 16:59:1683 bool HasObserver(const WindowTreeHostObserver* observer) const;
[email protected]a06955222014-03-10 22:47:3284
[email protected]2374d1812014-03-04 03:42:2785 Window* window() { return window_; }
86 const Window* window() const { return window_; }
[email protected]2f2620332014-02-28 10:07:3887
penghuang17134c6c2017-03-23 00:01:0788 ui::EventSink* event_sink();
[email protected]2d6eb742014-03-05 18:59:0389
[email protected]2f2620332014-02-28 10:07:3890 WindowEventDispatcher* dispatcher() {
91 return const_cast<WindowEventDispatcher*>(
92 const_cast<const WindowTreeHost*>(this)->dispatcher());
93 }
94 const WindowEventDispatcher* dispatcher() const { return dispatcher_.get(); }
[email protected]0a04ef12013-12-19 20:15:4095
96 ui::Compositor* compositor() { return compositor_.get(); }
97
[email protected]f5c9dbc2014-04-11 08:13:4598 // Gets/Sets the root window's transform.
99 virtual gfx::Transform GetRootTransform() const;
100 virtual void SetRootTransform(const gfx::Transform& transform);
101 virtual gfx::Transform GetInverseRootTransform() const;
[email protected]0a04ef12013-12-19 20:15:40102
Scott Violet215d2d42017-08-25 21:16:01103 // These functions are used in event translation for translating the local
Scott Violet64fde6f72017-09-13 18:07:44104 // coordinates of LocatedEvents. Default implementation calls to non-local
Scott Violet215d2d42017-08-25 21:16:01105 // ones (e.g. GetRootTransform()).
106 virtual gfx::Transform GetRootTransformForLocalEventCoordinates() const;
107 virtual gfx::Transform GetInverseRootTransformForLocalEventCoordinates()
108 const;
109
riajiang8077b132016-11-29 23:35:36110 // Updates the root window's size using |host_size_in_pixels|, current
skyf554cab2015-11-26 06:03:53111 // transform and outsets.
Sadrul Habib Chowdhurya8244722018-04-12 06:01:01112 // TODO(ccameron): Make this function no longer public. The interaction
113 // between this call, GetBounds, and OnHostResizedInPixels is ambiguous and
114 // allows for inconsistencies.
115 void UpdateRootWindowSizeInPixels();
[email protected]0a04ef12013-12-19 20:15:40116
[email protected]0a04ef12013-12-19 20:15:40117 // Converts |point| from the root window's coordinate system to native
118 // screen's.
riajiang8077b132016-11-29 23:35:36119 void ConvertDIPToScreenInPixels(gfx::Point* point) const;
[email protected]0a04ef12013-12-19 20:15:40120
121 // Converts |point| from native screen coordinate system to the root window's.
riajiang8077b132016-11-29 23:35:36122 void ConvertScreenInPixelsToDIP(gfx::Point* point) const;
[email protected]0a04ef12013-12-19 20:15:40123
124 // Converts |point| from the root window's coordinate system to the
125 // host window's.
Ahmed Fakhry4f8e3722017-10-31 21:01:58126 virtual void ConvertDIPToPixels(gfx::Point* point) const;
[email protected]0a04ef12013-12-19 20:15:40127
128 // Converts |point| from the host window's coordinate system to the
129 // root window's.
Ahmed Fakhry4f8e3722017-10-31 21:01:58130 virtual void ConvertPixelsToDIP(gfx::Point* point) const;
[email protected]0a04ef12013-12-19 20:15:40131
[email protected]4c090d22014-02-16 04:21:54132 // Cursor.
133 // Sets the currently-displayed cursor. If the cursor was previously hidden
134 // via ShowCursor(false), it will remain hidden until ShowCursor(true) is
135 // called, at which point the cursor that was last set via SetCursor() will be
136 // used.
137 void SetCursor(gfx::NativeCursor cursor);
138
139 // Invoked when the cursor's visibility has changed.
140 void OnCursorVisibilityChanged(bool visible);
141
142 // Moves the cursor to the specified location relative to the root window.
riajiang8077b132016-11-29 23:35:36143 void MoveCursorToLocationInDIP(const gfx::Point& location_in_dip);
[email protected]4c090d22014-02-16 04:21:54144
riajiang8077b132016-11-29 23:35:36145 // Moves the cursor to the |location_in_pixels| given in host coordinates.
146 void MoveCursorToLocationInPixels(const gfx::Point& location_in_pixels);
[email protected]4c090d22014-02-16 04:21:54147
148 gfx::NativeCursor last_cursor() const { return last_cursor_; }
149
shuchen29f3c7a2015-06-10 07:48:28150 // Gets the InputMethod instance, if NULL, creates & owns it.
151 ui::InputMethod* GetInputMethod();
skycfaad892017-04-28 20:52:58152 bool has_input_method() const { return input_method_ != nullptr; }
shuchen29f3c7a2015-06-10 07:48:28153
154 // Sets a shared unowned InputMethod. This is used when there is a singleton
155 // InputMethod shared between multiple WindowTreeHost instances.
156 //
157 // This is used for Ash only. There are 2 reasons:
Darren Shen539c32a2018-07-03 05:27:43158 // 1) ChromeOS virtual keyboard needs to receive ShowVirtualKeyboardIfEnabled
159 // notification from InputMethod. Multiple InputMethod instances makes it hard
160 // to register/unregister the observer for that notification. 2) For Ozone,
161 // there is no native focus state for the root window and WindowTreeHost. See
162 // DrmWindowHost::CanDispatchEvent, the key events always goes to the primary
163 // WindowTreeHost. And after InputMethod processed the key event and continue
164 // dispatching it, WindowTargeter::FindTargetForEvent may re-dispatch it to a
165 // different WindowTreeHost. So the singleton InputMethod can make sure the
166 // correct InputMethod instance processes the key event no matter which
167 // WindowTreeHost is the target for event. Please refer to the test:
168 // ExtendedDesktopTest.KeyEventsOnLockScreen.
shuchen29f3c7a2015-06-10 07:48:28169 //
170 // TODO(shuchen): remove this method after above reasons become invalid.
171 // A possible solution is to make sure DrmWindowHost can find the correct
172 // WindowTreeHost to dispatch events.
173 void SetSharedInputMethod(ui::InputMethod* input_method);
174
175 // Overridden from ui::internal::InputMethodDelegate:
Scott Violetad6366d2018-09-27 21:33:19176 ui::EventDispatchDetails DispatchKeyEventPostIME(
177 ui::KeyEvent* event,
178 base::OnceCallback<void(bool)> ack_callback) final;
shuchen29f3c7a2015-06-10 07:48:28179
Scott Violet2784cad2017-12-05 20:39:26180 // Returns the id of the display. Default implementation queries Screen.
181 virtual int64_t GetDisplayId();
182
[email protected]8ecd5fa2014-04-24 23:04:03183 // Returns the EventSource responsible for dispatching events to the window
184 // tree.
185 virtual ui::EventSource* GetEventSource() = 0;
186
[email protected]81585f32011-07-29 19:32:06187 // Returns the accelerated widget.
188 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0;
189
[email protected]641dcfd2014-01-08 16:41:23190 // Shows the WindowTreeHost.
jbauman8da589a2015-06-04 02:23:12191 void Show();
[email protected]81585f32011-07-29 19:32:06192
[email protected]641dcfd2014-01-08 16:41:23193 // Hides the WindowTreeHost.
jbauman8da589a2015-06-04 02:23:12194 void Hide();
[email protected]e46617f2012-08-17 22:43:46195
Sadrul Habib Chowdhury3c7fdca2018-04-18 05:08:40196 // Sets/Gets the bounds of the WindowTreeHost (in pixels). Note that a call to
197 // GetBoundsInPixels() immediately following a SetBoundsInPixels() can return
198 // the old bounds, because SetBoundsInPixels() can take effect asynchronously,
199 // depending on the platform. The |local_surface_id| takes effect when (and
200 // if) the new size is confirmed (potentially asynchronously) by the platform.
201 // If |local_surface_id| is invalid, then a new LocalSurfaceId is allocated
202 // when the size change takes effect.
203 virtual void SetBoundsInPixels(
204 const gfx::Rect& bounds_in_pixels,
jonross180dc482018-10-23 21:22:09205 const viz::LocalSurfaceId& local_surface_id = viz::LocalSurfaceId(),
206 base::TimeTicks allocation_time = base::TimeTicks()) = 0;
riajiangdfdfc99e2016-11-29 05:37:47207 virtual gfx::Rect GetBoundsInPixels() const = 0;
[email protected]70ccf702011-09-22 18:15:58208
[email protected]627a62f2012-02-14 22:59:14209 // Sets the OS capture to the root window.
[email protected]759017e02012-02-11 20:46:11210 virtual void SetCapture() = 0;
211
[email protected]627a62f2012-02-14 22:59:14212 // Releases OS capture of the root window.
[email protected]759017e02012-02-11 20:46:11213 virtual void ReleaseCapture() = 0;
214
Christopher Cameron7c4a8572018-03-16 08:03:02215 // Returns the device scale assumed by the WindowTreeHost (set during the
216 // most recent call to OnHostResizedInPixels).
217 float device_scale_factor() const { return device_scale_factor_; }
218
Joe Downinga8e74ac2018-02-26 17:10:24219 // Requests that |keys| be intercepted at the platform level and routed
Joe Downingf18d97c2018-05-03 04:41:44220 // directly to the web content. If |codes| is empty, all keys will be
Joe Downinga8e74ac2018-02-26 17:10:24221 // intercepted. Returns a ScopedKeyboardHook instance which stops capturing
222 // system key events when destroyed.
223 std::unique_ptr<ScopedKeyboardHook> CaptureSystemKeyEvents(
Joe Downingf18d97c2018-05-03 04:41:44224 base::Optional<base::flat_set<ui::DomCode>> codes);
Joe Downinga8e74ac2018-02-26 17:10:24225
Gary Kacmarcik9c79e1fe2018-05-15 15:57:20226 // Returns a map of KeyboardEvent code to KeyboardEvent key values.
227 virtual base::flat_map<std::string, std::string> GetKeyboardLayoutMap() = 0;
228
Scott Violet6c77e2f62018-10-19 16:38:42229 // Returns true if KeyEvents should be send to IME. This is called from
230 // WindowEventDispatcher during event dispatch.
231 virtual bool ShouldSendKeyEventToIme();
232
David Bienvenud0ddda32018-11-01 16:59:16233 // Enables native window occlusion tracking for the native window this host
234 // represents.
235 virtual void EnableNativeWindowOcclusionTracking();
236
237 // Disables native window occlusion tracking for the native window this host
238 // represents.
239 virtual void DisableNativeWindowOcclusionTracking();
240
241 // Remembers the current occlusion state, and if it has changed, notifies
242 // observers of the change.
243 virtual void SetNativeWindowOcclusionState(Window::OcclusionState state);
244
[email protected]228f0f02013-11-15 05:58:36245 protected:
Joe Downinga8e74ac2018-02-26 17:10:24246 friend class ScopedKeyboardHook;
[email protected]0a04ef12013-12-19 20:15:40247 friend class TestScreen; // TODO(beng): see if we can remove/consolidate.
248
Scott Violet36529162018-08-09 05:09:32249 explicit WindowTreeHost(std::unique_ptr<Window> window = nullptr);
sky631094cd2016-10-26 18:21:01250
[email protected]c051d5a52014-01-08 23:54:51251 void DestroyCompositor();
[email protected]2f2620332014-02-28 10:07:38252 void DestroyDispatcher();
[email protected]228f0f02013-11-15 05:58:36253
samans534dc4d2017-01-13 18:07:42254 // If frame_sink_id is not passed in, one will be grabbed from
Scott Violet2cc29e02018-05-31 22:59:33255 // ContextFactoryPrivate. |are_events_in_pixels| indicates if events are
256 // received in pixels. If |are_events_in_pixels| is false, events are
Scott Violet62d717bc2018-10-16 17:07:58257 // received in DIPs. See Compositor() for details on |trace_environment_name|.
samans534dc4d2017-01-13 18:07:42258 void CreateCompositor(
Tom Anderson1721ffa2017-08-09 05:55:24259 const viz::FrameSinkId& frame_sink_id = viz::FrameSinkId(),
Eric Seckler80a868a2017-10-10 22:57:44260 bool force_software_compositor = false,
Scott Violet2cc29e02018-05-31 22:59:33261 bool external_begin_frames_enabled = false,
Scott Violet62d717bc2018-10-16 17:07:58262 bool are_events_in_pixels = true,
263 const char* trace_environment_name = nullptr);
samans534dc4d2017-01-13 18:07:42264
mfomitchev7028deb32016-12-12 04:15:29265 void InitCompositor();
sieversb2a31d3372015-08-25 19:27:13266 void OnAcceleratedWidgetAvailable();
[email protected]0a04ef12013-12-19 20:15:40267
[email protected]228f0f02013-11-15 05:58:36268 // Returns the location of the RootWindow on native screen.
riajiang8077b132016-11-29 23:35:36269 virtual gfx::Point GetLocationOnScreenInPixels() const = 0;
[email protected]228f0f02013-11-15 05:58:36270
riajiang8077b132016-11-29 23:35:36271 void OnHostMovedInPixels(const gfx::Point& new_location_in_pixels);
Sadrul Habib Chowdhury3c7fdca2018-04-18 05:08:40272 void OnHostResizedInPixels(
273 const gfx::Size& new_size_in_pixels,
jonross180dc482018-10-23 21:22:09274 const viz::LocalSurfaceId& local_surface_id = viz::LocalSurfaceId(),
275 base::TimeTicks new_allocation_time = base::TimeTicks());
thomasanderson06405c52016-05-03 22:52:22276 void OnHostWorkspaceChanged();
Christopher Cameronfd90d2762017-09-22 08:11:33277 void OnHostDisplayChanged();
[email protected]2d6eb742014-03-05 18:59:03278 void OnHostCloseRequested();
[email protected]d04aca192014-03-07 05:00:17279 void OnHostLostWindowCapture();
[email protected]0a04ef12013-12-19 20:15:40280
[email protected]4c090d22014-02-16 04:21:54281 // Sets the currently displayed cursor.
282 virtual void SetCursorNative(gfx::NativeCursor cursor) = 0;
283
284 // Moves the cursor to the specified location relative to the root window.
riajiang8077b132016-11-29 23:35:36285 virtual void MoveCursorToScreenLocationInPixels(
286 const gfx::Point& location_in_pixels) = 0;
[email protected]4c090d22014-02-16 04:21:54287
Scott Violet17a61722017-06-19 17:54:31288 // Called when the cursor visibility has changed.
[email protected]4c090d22014-02-16 04:21:54289 virtual void OnCursorVisibilityChangedNative(bool show) = 0;
290
jbauman8da589a2015-06-04 02:23:12291 // Shows the WindowTreeHost.
292 virtual void ShowImpl() = 0;
293
294 // Hides the WindowTreeHost.
295 virtual void HideImpl() = 0;
296
shuchen29f3c7a2015-06-10 07:48:28297 // Overridden from ui::EventSource:
penghuang17134c6c2017-03-23 00:01:07298 ui::EventSink* GetEventSink() override;
shuchen29f3c7a2015-06-10 07:48:28299
Christopher Cameron1f3a4e3e2017-07-18 06:16:01300 // display::DisplayObserver implementation.
Christopher Cameron1f3a4e3e2017-07-18 06:16:01301 void OnDisplayMetricsChanged(const display::Display& display,
302 uint32_t metrics) override;
303
Joe Downinga8e74ac2018-02-26 17:10:24304 // Begins capturing system key events. Returns true if successful.
305 virtual bool CaptureSystemKeyEventsImpl(
Joe Downingf18d97c2018-05-03 04:41:44306 base::Optional<base::flat_set<ui::DomCode>> dom_codes) = 0;
Joe Downinga8e74ac2018-02-26 17:10:24307
308 // Stops capturing system keyboard events.
309 virtual void ReleaseSystemKeyEventCapture() = 0;
310
Joe Downingf18d97c2018-05-03 04:41:44311 // True if |dom_code| is reserved for an active KeyboardLock request.
312 virtual bool IsKeyLocked(ui::DomCode dom_code) = 0;
Joe Downing87cdad6f2018-04-09 06:27:14313
Sadrul Habib Chowdhury92bbab92018-04-11 19:23:20314 virtual gfx::Rect GetTransformedRootWindowBoundsInPixels(
315 const gfx::Size& size_in_pixels) const;
316
Trent Apteda250ec3ab2018-08-19 08:52:19317 const base::ObserverList<WindowTreeHostObserver>::Unchecked& observers()
318 const {
Michael Wasserman625b7382017-12-13 16:34:32319 return observers_;
320 }
321
[email protected]228f0f02013-11-15 05:58:36322 private:
[email protected]dc645d52014-04-28 14:42:55323 friend class test::WindowTreeHostTestApi;
324
[email protected]4c090d22014-02-16 04:21:54325 // Moves the cursor to the specified location. This method is internally used
riajiang8077b132016-11-29 23:35:36326 // by MoveCursorToLocationInDIP() and MoveCursorToLocationInPixels().
[email protected]4c090d22014-02-16 04:21:54327 void MoveCursorToInternal(const gfx::Point& root_location,
328 const gfx::Point& host_location);
329
Fady Samueld7625cc02017-10-13 05:25:18330 // Overrided from CompositorObserver:
331 void OnCompositingDidCommit(ui::Compositor* compositor) override;
332 void OnCompositingStarted(ui::Compositor* compositor,
333 base::TimeTicks start_time) override;
334 void OnCompositingEnded(ui::Compositor* compositor) override;
Fady Samueld7625cc02017-10-13 05:25:18335 void OnCompositingChildResizing(ui::Compositor* compositor) override;
336 void OnCompositingShuttingDown(ui::Compositor* compositor) override;
337
joone.hur21f7c90c2016-05-12 16:25:15338 // We don't use a std::unique_ptr for |window_| since we need this ptr to be
339 // valid during its deletion. (Window's dtor notifies observers that may
340 // attempt to reach back up to access this object which will be valid until
341 // the end of the dtor).
[email protected]2374d1812014-03-04 03:42:27342 Window* window_; // Owning.
343
David Bienvenud0ddda32018-11-01 16:59:16344 // Keeps track of the occlusion state of the host, and used to send
345 // notifications to observers when it changes.
346 Window::OcclusionState occlusion_state_;
347
Trent Apteda250ec3ab2018-08-19 08:52:19348 base::ObserverList<WindowTreeHostObserver>::Unchecked observers_;
[email protected]2d6eb742014-03-05 18:59:03349
danakj25c52c32016-04-12 21:51:08350 std::unique_ptr<WindowEventDispatcher> dispatcher_;
[email protected]2f2620332014-02-28 10:07:38351
danakj25c52c32016-04-12 21:51:08352 std::unique_ptr<ui::Compositor> compositor_;
[email protected]0a04ef12013-12-19 20:15:40353
Christopher Cameronfa890682018-03-12 20:29:31354 // The device scale factor is snapshotted in OnHostResizedInPixels.
355 // TODO(ccameron): The size and location from OnHostResizedInPixels and
356 // OnHostMovedInPixels should be snapshotted here as well.
357 float device_scale_factor_ = 1.f;
358
[email protected]4c090d22014-02-16 04:21:54359 // Last cursor set. Used for testing.
360 gfx::NativeCursor last_cursor_;
[email protected]dc645d52014-04-28 14:42:55361 gfx::Point last_cursor_request_position_in_host_;
[email protected]4c090d22014-02-16 04:21:54362
danakj25c52c32016-04-12 21:51:08363 std::unique_ptr<ui::ViewProp> prop_;
[email protected]2374d1812014-03-04 03:42:27364
shuchen29f3c7a2015-06-10 07:48:28365 // The InputMethod instance used to process key events.
366 // If owned it, it is created in GetInputMethod() method;
367 // If not owned it, it is passed in through SetSharedInputMethod() method.
368 ui::InputMethod* input_method_;
369
370 // Whether the InputMethod instance is owned by this WindowTreeHost.
371 bool owned_input_method_;
372
Fady Samuel9f845132017-11-28 17:33:24373 // Set to the time the synchronization event began.
374 base::TimeTicks synchronization_start_time_;
375
Fady Samueld7625cc02017-10-13 05:25:18376 // Set to true if this WindowTreeHost is currently holding pointer moves.
377 bool holding_pointer_moves_ = false;
378
Joe Downinga8e74ac2018-02-26 17:10:24379 base::WeakPtrFactory<WindowTreeHost> weak_factory_;
380
[email protected]641dcfd2014-01-08 16:41:23381 DISALLOW_COPY_AND_ASSIGN(WindowTreeHost);
[email protected]81585f32011-07-29 19:32:06382};
383
384} // namespace aura
385
[email protected]e8cf7332014-02-14 18:54:58386#endif // UI_AURA_WINDOW_TREE_HOST_H_