Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ui / aura / window_tree_host.h
index ca4a164..9d54944 100644 (file)
@@ -11,6 +11,7 @@
 #include "base/message_loop/message_loop.h"
 #include "ui/aura/aura_export.h"
 #include "ui/base/cursor/cursor.h"
+#include "ui/events/event_source.h"
 #include "ui/gfx/native_widget_types.h"
 
 namespace gfx {
@@ -28,7 +29,10 @@ class ViewProp;
 }
 
 namespace aura {
-class RootWindowTransformer;
+namespace test {
+class WindowTreeHostTestApi;
+}
+
 class WindowEventDispatcher;
 class WindowTreeHostObserver;
 
@@ -66,16 +70,14 @@ class AURA_EXPORT WindowTreeHost {
 
   ui::Compositor* compositor() { return compositor_.get(); }
 
-  void SetRootWindowTransformer(scoped_ptr<RootWindowTransformer> transformer);
-  gfx::Transform GetRootTransform() const;
-
-  void SetTransform(const gfx::Transform& transform);
-
-  gfx::Transform GetInverseRootTransform() const;
+  // Gets/Sets the root window's transform.
+  virtual gfx::Transform GetRootTransform() const;
+  virtual void SetRootTransform(const gfx::Transform& transform);
+  virtual gfx::Transform GetInverseRootTransform() const;
 
   // Updates the root window's size using |host_size|, current
   // transform and insets.
-  void UpdateRootWindowSize(const gfx::Size& host_size);
+  virtual void UpdateRootWindowSize(const gfx::Size& host_size);
 
   // Returns the actual size of the screen.
   // (gfx::Screen only reports on the virtual desktop exposed by Aura.)
@@ -114,6 +116,10 @@ class AURA_EXPORT WindowTreeHost {
 
   gfx::NativeCursor last_cursor() const { return last_cursor_; }
 
+  // Returns the EventSource responsible for dispatching events to the window
+  // tree.
+  virtual ui::EventSource* GetEventSource() = 0;
+
   // Returns the accelerated widget.
   virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0;
 
@@ -123,40 +129,16 @@ class AURA_EXPORT WindowTreeHost {
   // Hides the WindowTreeHost.
   virtual void Hide() = 0;
 
-  // Toggles the host's full screen state.
-  virtual void ToggleFullScreen() = 0;
-
   // Gets/Sets the size of the WindowTreeHost.
   virtual gfx::Rect GetBounds() const = 0;
   virtual void SetBounds(const gfx::Rect& bounds) = 0;
 
-  // Sets/Gets the insets that specifies the effective root window area
-  // in the host window.
-  virtual gfx::Insets GetInsets() const = 0;
-  virtual void SetInsets(const gfx::Insets& insets) = 0;
-
   // Sets the OS capture to the root window.
   virtual void SetCapture() = 0;
 
   // Releases OS capture of the root window.
   virtual void ReleaseCapture() = 0;
 
-  // Queries the mouse's current position relative to the host window and sets
-  // it in |location_return|. Returns true if the cursor is within the host
-  // window. The position set to |location_return| is constrained within the
-  // host window. If the cursor is disabled, returns false and (0, 0) is set to
-  // |location_return|.
-  // This method is expensive, instead use gfx::Screen::GetCursorScreenPoint().
-  virtual bool QueryMouseLocation(gfx::Point* location_return) = 0;
-
-  // Clips the cursor to the bounds of the root window until UnConfineCursor().
-  // We would like to be able to confine the cursor to that window. However,
-  // currently, we do not have such functionality in X. So we just confine
-  // to the root window. This is ok because this option is currently only
-  // being used in fullscreen mode, so root_window bounds = window bounds.
-  virtual bool ConfineCursorToRootWindow() = 0;
-  virtual void UnConfineCursor() = 0;
-
   // Posts |native_event| to the platform's event queue.
   virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0;
 
@@ -191,6 +173,8 @@ class AURA_EXPORT WindowTreeHost {
   virtual void OnCursorVisibilityChangedNative(bool show) = 0;
 
  private:
+  friend class test::WindowTreeHostTestApi;
+
   // Moves the cursor to the specified location. This method is internally used
   // by MoveCursorTo() and MoveCursorToHostLocation().
   void MoveCursorToInternal(const gfx::Point& root_location,
@@ -208,10 +192,9 @@ class AURA_EXPORT WindowTreeHost {
 
   scoped_ptr<ui::Compositor> compositor_;
 
-  scoped_ptr<RootWindowTransformer> transformer_;
-
   // Last cursor set.  Used for testing.
   gfx::NativeCursor last_cursor_;
+  gfx::Point last_cursor_request_position_in_host_;
 
   scoped_ptr<ui::ViewProp> prop_;