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 COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ | 5 #ifndef COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ |
6 #define COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ | 6 #define COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 virtual void Init(DisplayManagerDelegate* delegate) = 0; | 61 virtual void Init(DisplayManagerDelegate* delegate) = 0; |
62 | 62 |
63 // Schedules a paint for the specified region in the coordinates of |window|. | 63 // Schedules a paint for the specified region in the coordinates of |window|. |
64 virtual void SchedulePaint(const ServerWindow* window, | 64 virtual void SchedulePaint(const ServerWindow* window, |
65 const gfx::Rect& bounds) = 0; | 65 const gfx::Rect& bounds) = 0; |
66 | 66 |
67 virtual void SetViewportSize(const gfx::Size& size) = 0; | 67 virtual void SetViewportSize(const gfx::Size& size) = 0; |
68 | 68 |
69 virtual void SetTitle(const base::string16& title) = 0; | 69 virtual void SetTitle(const base::string16& title) = 0; |
70 | 70 |
| 71 virtual void SetCapture() = 0; |
| 72 |
| 73 virtual void ReleaseCapture() = 0; |
| 74 |
71 virtual const mojom::ViewportMetrics& GetViewportMetrics() = 0; | 75 virtual const mojom::ViewportMetrics& GetViewportMetrics() = 0; |
72 | 76 |
73 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; | 77 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; |
74 virtual void SetImeVisibility(bool visible) = 0; | 78 virtual void SetImeVisibility(bool visible) = 0; |
75 | 79 |
76 // Returns true if a compositor frame has been submitted but not drawn yet. | 80 // Returns true if a compositor frame has been submitted but not drawn yet. |
77 virtual bool IsFramePending() const = 0; | 81 virtual bool IsFramePending() const = 0; |
78 | 82 |
79 // Overrides factory for testing. Default (NULL) value indicates regular | 83 // Overrides factory for testing. Default (NULL) value indicates regular |
80 // (non-test) environment. | 84 // (non-test) environment. |
(...skipping 15 matching lines...) Expand all Loading... |
96 const scoped_refptr<GpuState>& gpu_state, | 100 const scoped_refptr<GpuState>& gpu_state, |
97 const scoped_refptr<SurfacesState>& surfaces_state); | 101 const scoped_refptr<SurfacesState>& surfaces_state); |
98 ~DefaultDisplayManager() override; | 102 ~DefaultDisplayManager() override; |
99 | 103 |
100 // DisplayManager: | 104 // DisplayManager: |
101 void Init(DisplayManagerDelegate* delegate) override; | 105 void Init(DisplayManagerDelegate* delegate) override; |
102 void SchedulePaint(const ServerWindow* window, | 106 void SchedulePaint(const ServerWindow* window, |
103 const gfx::Rect& bounds) override; | 107 const gfx::Rect& bounds) override; |
104 void SetViewportSize(const gfx::Size& size) override; | 108 void SetViewportSize(const gfx::Size& size) override; |
105 void SetTitle(const base::string16& title) override; | 109 void SetTitle(const base::string16& title) override; |
| 110 void SetCapture() override; |
| 111 void ReleaseCapture() override; |
106 const mojom::ViewportMetrics& GetViewportMetrics() override; | 112 const mojom::ViewportMetrics& GetViewportMetrics() override; |
107 void UpdateTextInputState(const ui::TextInputState& state) override; | 113 void UpdateTextInputState(const ui::TextInputState& state) override; |
108 void SetImeVisibility(bool visible) override; | 114 void SetImeVisibility(bool visible) override; |
109 bool IsFramePending() const override; | 115 bool IsFramePending() const override; |
110 | 116 |
111 private: | 117 private: |
112 void WantToDraw(); | 118 void WantToDraw(); |
113 | 119 |
114 // This method initiates a top level redraw of the display. | 120 // This method initiates a top level redraw of the display. |
115 // TODO(fsamuel): This should use vblank as a signal rather than a timer | 121 // TODO(fsamuel): This should use vblank as a signal rather than a timer |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; | 158 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; |
153 | 159 |
154 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); | 160 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); |
155 }; | 161 }; |
156 | 162 |
157 } // namespace ws | 163 } // namespace ws |
158 | 164 |
159 } // namespace mus | 165 } // namespace mus |
160 | 166 |
161 #endif // COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ | 167 #endif // COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ |
OLD | NEW |