OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_H_ | 5 #ifndef MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_H_ |
6 #define MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_H_ | 6 #define MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_H_ |
7 | 7 |
| 8 #include "base/macros.h" |
8 #include "mojo/services/public/cpp/view_manager/view_observer.h" | 9 #include "mojo/services/public/cpp/view_manager/view_observer.h" |
9 #include "ui/aura/window_tree_host.h" | 10 #include "ui/aura/window_tree_host.h" |
10 #include "ui/events/event_source.h" | 11 #include "ui/events/event_source.h" |
11 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
12 | 13 |
13 class SkBitmap; | 14 class SkBitmap; |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 class Compositor; | 17 class Compositor; |
17 } | 18 } |
(...skipping 17 matching lines...) Expand all Loading... |
35 // Sets the contents to show in this WindowTreeHost. This forwards to the | 36 // Sets the contents to show in this WindowTreeHost. This forwards to the |
36 // delegate. | 37 // delegate. |
37 void SetContents(const SkBitmap& contents); | 38 void SetContents(const SkBitmap& contents); |
38 | 39 |
39 ui::EventDispatchDetails SendEventToProcessor(ui::Event* event) { | 40 ui::EventDispatchDetails SendEventToProcessor(ui::Event* event) { |
40 return ui::EventSource::SendEventToProcessor(event); | 41 return ui::EventSource::SendEventToProcessor(event); |
41 } | 42 } |
42 | 43 |
43 private: | 44 private: |
44 // WindowTreeHost: | 45 // WindowTreeHost: |
45 virtual ui::EventSource* GetEventSource() OVERRIDE; | 46 virtual ui::EventSource* GetEventSource() override; |
46 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 47 virtual gfx::AcceleratedWidget GetAcceleratedWidget() override; |
47 virtual void Show() OVERRIDE; | 48 virtual void Show() override; |
48 virtual void Hide() OVERRIDE; | 49 virtual void Hide() override; |
49 virtual gfx::Rect GetBounds() const OVERRIDE; | 50 virtual gfx::Rect GetBounds() const override; |
50 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 51 virtual void SetBounds(const gfx::Rect& bounds) override; |
51 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; | 52 virtual gfx::Point GetLocationOnNativeScreen() const override; |
52 virtual void SetCapture() OVERRIDE; | 53 virtual void SetCapture() override; |
53 virtual void ReleaseCapture() OVERRIDE; | 54 virtual void ReleaseCapture() override; |
54 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 55 virtual void PostNativeEvent(const base::NativeEvent& native_event) override; |
55 virtual void SetCursorNative(gfx::NativeCursor cursor) OVERRIDE; | 56 virtual void SetCursorNative(gfx::NativeCursor cursor) override; |
56 virtual void MoveCursorToNative(const gfx::Point& location) OVERRIDE; | 57 virtual void MoveCursorToNative(const gfx::Point& location) override; |
57 virtual void OnCursorVisibilityChangedNative(bool show) OVERRIDE; | 58 virtual void OnCursorVisibilityChangedNative(bool show) override; |
58 | 59 |
59 // ui::EventSource: | 60 // ui::EventSource: |
60 virtual ui::EventProcessor* GetEventProcessor() OVERRIDE; | 61 virtual ui::EventProcessor* GetEventProcessor() override; |
61 | 62 |
62 // ViewObserver: | 63 // ViewObserver: |
63 virtual void OnViewBoundsChanged( | 64 virtual void OnViewBoundsChanged(View* view, |
64 View* view, | 65 const gfx::Rect& old_bounds, |
65 const gfx::Rect& old_bounds, | 66 const gfx::Rect& new_bounds) override; |
66 const gfx::Rect& new_bounds) OVERRIDE; | |
67 | 67 |
68 View* view_; | 68 View* view_; |
69 | 69 |
70 gfx::Rect bounds_; | 70 gfx::Rect bounds_; |
71 | 71 |
72 WindowTreeHostMojoDelegate* delegate_; | 72 WindowTreeHostMojoDelegate* delegate_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMojo); | 74 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMojo); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace mojo | 77 } // namespace mojo |
78 | 78 |
79 #endif // MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_H_ | 79 #endif // MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_H_ |
OLD | NEW |