1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MANDOLINE_UI_AURA_WINDOW_TREE_HOST_MOJO_H_
6 #define MANDOLINE_UI_AURA_WINDOW_TREE_HOST_MOJO_H_
8 #include "base/macros.h"
9 #include "components/view_manager/public/cpp/view_observer.h"
10 #include "ui/aura/window_tree_host.h"
11 #include "ui/events/event_source.h"
12 #include "ui/gfx/geometry/rect.h"
26 class SurfaceContextFactory
;
28 class WindowTreeHostMojo
: public aura::WindowTreeHost
,
29 public mojo::ViewObserver
{
31 WindowTreeHostMojo(mojo::Shell
* shell
, mojo::View
* view
);
32 ~WindowTreeHostMojo() override
;
34 const gfx::Rect
& bounds() const { return bounds_
; }
36 ui::EventDispatchDetails
SendEventToProcessor(ui::Event
* event
) {
37 return ui::EventSource::SendEventToProcessor(event
);
42 ui::EventSource
* GetEventSource() override
;
43 gfx::AcceleratedWidget
GetAcceleratedWidget() override
;
44 void ShowImpl() override
;
45 void HideImpl() override
;
46 gfx::Rect
GetBounds() const override
;
47 void SetBounds(const gfx::Rect
& bounds
) override
;
48 gfx::Point
GetLocationOnNativeScreen() const override
;
49 void SetCapture() override
;
50 void ReleaseCapture() override
;
51 void SetCursorNative(gfx::NativeCursor cursor
) override
;
52 void MoveCursorToNative(const gfx::Point
& location
) override
;
53 void OnCursorVisibilityChangedNative(bool show
) override
;
55 // mojo::ViewObserver:
56 void OnViewBoundsChanged(mojo::View
* view
,
57 const mojo::Rect
& old_bounds
,
58 const mojo::Rect
& new_bounds
) override
;
64 scoped_ptr
<SurfaceContextFactory
> context_factory_
;
66 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMojo
);
69 } // namespace mandoline
71 #endif // MANDOLINE_UI_AURA_WINDOW_TREE_HOST_MOJO_H_