window_tree_host.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef UI_AURA_WINDOW_TREE_HOST_H_
65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define UI_AURA_WINDOW_TREE_HOST_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <vector>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/event_types.h"
11ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch#include "base/message_loop/message_loop.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/aura/aura_export.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/base/cursor/cursor.h"
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/native_widget_types.h"
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace gfx {
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class Insets;
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Point;
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Rect;
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Size;
215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class Transform;
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}
235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace ui {
255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class Compositor;
26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class EventProcessor;
27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class ViewProp;
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace aura {
315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class RootWindowTransformer;
32a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class WindowEventDispatcher;
33a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class WindowTreeHostObserver;
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// WindowTreeHost bridges between a native window and the embedded RootWindow.
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// It provides the accelerated widget and maps events from the native os to
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// aura.
385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class AURA_EXPORT WindowTreeHost {
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual ~WindowTreeHost();
415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
425d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Creates a new WindowTreeHost. The caller owns the returned value.
435d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static WindowTreeHost* Create(const gfx::Rect& bounds);
445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
45a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // Returns the WindowTreeHost for the specified accelerated widget, or NULL
46a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // if there is none associated.
47a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  static WindowTreeHost* GetForAcceleratedWidget(gfx::AcceleratedWidget widget);
48a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
495d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void InitHost();
505d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
515d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void InitCompositor();
525d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
53a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  void AddObserver(WindowTreeHostObserver* observer);
54a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  void RemoveObserver(WindowTreeHostObserver* observer);
55a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
56a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  Window* window() { return window_; }
57a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  const Window* window() const { return window_; }
58a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
59a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  ui::EventProcessor* event_processor();
60a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
61a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  WindowEventDispatcher* dispatcher() {
62a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    return const_cast<WindowEventDispatcher*>(
63a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)        const_cast<const WindowTreeHost*>(this)->dispatcher());
64a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  }
65a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  const WindowEventDispatcher* dispatcher() const { return dispatcher_.get(); }
665d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
675d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  ui::Compositor* compositor() { return compositor_.get(); }
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
695d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void SetRootWindowTransformer(scoped_ptr<RootWindowTransformer> transformer);
705d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  gfx::Transform GetRootTransform() const;
715d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
725d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void SetTransform(const gfx::Transform& transform);
735d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
745d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  gfx::Transform GetInverseRootTransform() const;
755d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
765d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Updates the root window's size using |host_size|, current
775d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // transform and insets.
785d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void UpdateRootWindowSize(const gfx::Size& host_size);
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns the actual size of the screen.
815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // (gfx::Screen only reports on the virtual desktop exposed by Aura.)
825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  static gfx::Size GetNativeScreenSize();
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
845d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Converts |point| from the root window's coordinate system to native
855d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // screen's.
865d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void ConvertPointToNativeScreen(gfx::Point* point) const;
875d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
885d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Converts |point| from native screen coordinate system to the root window's.
895d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void ConvertPointFromNativeScreen(gfx::Point* point) const;
905d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
915d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Converts |point| from the root window's coordinate system to the
925d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // host window's.
935d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void ConvertPointToHost(gfx::Point* point) const;
945d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
955d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Converts |point| from the host window's coordinate system to the
965d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // root window's.
975d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void ConvertPointFromHost(gfx::Point* point) const;
985d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
995d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Cursor.
1005d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Sets the currently-displayed cursor. If the cursor was previously hidden
1015d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // via ShowCursor(false), it will remain hidden until ShowCursor(true) is
1025d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // called, at which point the cursor that was last set via SetCursor() will be
1035d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // used.
1045d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void SetCursor(gfx::NativeCursor cursor);
1055d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1065d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Invoked when the cursor's visibility has changed.
1075d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void OnCursorVisibilityChanged(bool visible);
1085d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1095d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Moves the cursor to the specified location relative to the root window.
1105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void MoveCursorTo(const gfx::Point& location);
1115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Moves the cursor to the |host_location| given in host coordinates.
1135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void MoveCursorToHostLocation(const gfx::Point& host_location);
1145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  gfx::NativeCursor last_cursor() const { return last_cursor_; }
1165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns the accelerated widget.
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0;
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Shows the WindowTreeHost.
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Show() = 0;
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Hides the WindowTreeHost.
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void Hide() = 0;
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Toggles the host's full screen state.
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ToggleFullScreen() = 0;
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Gets/Sets the size of the WindowTreeHost.
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual gfx::Rect GetBounds() const = 0;
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetBounds(const gfx::Rect& bounds) = 0;
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Sets/Gets the insets that specifies the effective root window area
1342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // in the host window.
1352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual gfx::Insets GetInsets() const = 0;
1362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual void SetInsets(const gfx::Insets& insets) = 0;
1372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Sets the OS capture to the root window.
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void SetCapture() = 0;
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Releases OS capture of the root window.
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void ReleaseCapture() = 0;
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Queries the mouse's current position relative to the host window and sets
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // it in |location_return|. Returns true if the cursor is within the host
1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // window. The position set to |location_return| is constrained within the
1472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // host window. If the cursor is disabled, returns false and (0, 0) is set to
1482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // |location_return|.
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // This method is expensive, instead use gfx::Screen::GetCursorScreenPoint().
1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool QueryMouseLocation(gfx::Point* location_return) = 0;
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Clips the cursor to the bounds of the root window until UnConfineCursor().
153f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // We would like to be able to confine the cursor to that window. However,
154f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // currently, we do not have such functionality in X. So we just confine
155f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // to the root window. This is ok because this option is currently only
156f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // being used in fullscreen mode, so root_window bounds = window bounds.
1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual bool ConfineCursorToRootWindow() = 0;
1585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void UnConfineCursor() = 0;
1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Posts |native_event| to the platform's event queue.
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0;
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Called when the device scale factor of the root window has chagned.
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0;
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Stop listening events in preparation for shutdown.
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void PrepareForShutdown() = 0;
168f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
169f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) protected:
1705d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  friend class TestScreen;  // TODO(beng): see if we can remove/consolidate.
1715d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1725d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  WindowTreeHost();
1735d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void DestroyCompositor();
174a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  void DestroyDispatcher();
1755d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1765d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void CreateCompositor(gfx::AcceleratedWidget accelerated_widget);
177f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
178f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // Returns the location of the RootWindow on native screen.
179f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual gfx::Point GetLocationOnNativeScreen() const = 0;
180f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
181a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  void OnHostMoved(const gfx::Point& new_location);
182a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  void OnHostResized(const gfx::Size& new_size);
183a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  void OnHostCloseRequested();
184a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  void OnHostActivated();
185a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  void OnHostLostWindowCapture();
1865d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1875d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Sets the currently displayed cursor.
1885d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void SetCursorNative(gfx::NativeCursor cursor) = 0;
1895d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1905d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Moves the cursor to the specified location relative to the root window.
1915d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void MoveCursorToNative(const gfx::Point& location) = 0;
1925d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1935d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // kCalled when the cursor visibility has changed.
1945d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void OnCursorVisibilityChangedNative(bool show) = 0;
1955d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
196f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) private:
1975d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Moves the cursor to the specified location. This method is internally used
1985d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // by MoveCursorTo() and MoveCursorToHostLocation().
1995d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  void MoveCursorToInternal(const gfx::Point& root_location,
2005d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                            const gfx::Point& host_location);
2015d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
202a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // We don't use a scoped_ptr for |window_| since we need this ptr to be valid
203a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // during its deletion. (Window's dtor notifies observers that may attempt to
204a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // reach back up to access this object which will be valid until the end of
205a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // the dtor).
206a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  Window* window_;  // Owning.
207a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
208a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  ObserverList<WindowTreeHostObserver> observers_;
209a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
210a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  scoped_ptr<WindowEventDispatcher> dispatcher_;
211a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
2125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  scoped_ptr<ui::Compositor> compositor_;
2135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
2145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  scoped_ptr<RootWindowTransformer> transformer_;
2155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
2165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Last cursor set.  Used for testing.
2175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  gfx::NativeCursor last_cursor_;
2185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
219a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  scoped_ptr<ui::ViewProp> prop_;
220a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
2215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(WindowTreeHost);
2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace aura
2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif  // UI_AURA_WINDOW_TREE_HOST_H_
227