#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 {
}
namespace aura {
-class RootWindowTransformer;
+namespace test {
+class WindowTreeHostTestApi;
+}
+
class WindowEventDispatcher;
class WindowTreeHostObserver;
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.)
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;
// 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;
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,
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_;