| 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_DISPLAY_MANAGER_H_ | 5 #ifndef COMPONENTS_MUS_DISPLAY_MANAGER_H_ |
| 6 #define COMPONENTS_MUS_DISPLAY_MANAGER_H_ | 6 #define COMPONENTS_MUS_DISPLAY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual void Init(DisplayManagerDelegate* delegate) = 0; | 58 virtual void Init(DisplayManagerDelegate* delegate) = 0; |
| 59 | 59 |
| 60 // Schedules a paint for the specified region in the coordinates of |view|. | 60 // Schedules a paint for the specified region in the coordinates of |view|. |
| 61 virtual void SchedulePaint(const ServerView* view, | 61 virtual void SchedulePaint(const ServerView* view, |
| 62 const gfx::Rect& bounds) = 0; | 62 const gfx::Rect& bounds) = 0; |
| 63 | 63 |
| 64 virtual void SetViewportSize(const gfx::Size& size) = 0; | 64 virtual void SetViewportSize(const gfx::Size& size) = 0; |
| 65 | 65 |
| 66 virtual void SetTitle(const base::string16& title) = 0; | 66 virtual void SetTitle(const base::string16& title) = 0; |
| 67 | 67 |
| 68 virtual void SetCapture() = 0; |
| 69 |
| 68 virtual const mojo::ViewportMetrics& GetViewportMetrics() = 0; | 70 virtual const mojo::ViewportMetrics& GetViewportMetrics() = 0; |
| 69 | 71 |
| 70 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; | 72 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; |
| 71 virtual void SetImeVisibility(bool visible) = 0; | 73 virtual void SetImeVisibility(bool visible) = 0; |
| 72 | 74 |
| 73 // Overrides factory for testing. Default (NULL) value indicates regular | 75 // Overrides factory for testing. Default (NULL) value indicates regular |
| 74 // (non-test) environment. | 76 // (non-test) environment. |
| 75 static void set_factory_for_testing(DisplayManagerFactory* factory) { | 77 static void set_factory_for_testing(DisplayManagerFactory* factory) { |
| 76 DisplayManager::factory_ = factory; | 78 DisplayManager::factory_ = factory; |
| 77 } | 79 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 90 mojo::ApplicationImpl* app_impl, | 92 mojo::ApplicationImpl* app_impl, |
| 91 const scoped_refptr<GpuState>& gpu_state, | 93 const scoped_refptr<GpuState>& gpu_state, |
| 92 const scoped_refptr<SurfacesState>& surfaces_state); | 94 const scoped_refptr<SurfacesState>& surfaces_state); |
| 93 ~DefaultDisplayManager() override; | 95 ~DefaultDisplayManager() override; |
| 94 | 96 |
| 95 // DisplayManager: | 97 // DisplayManager: |
| 96 void Init(DisplayManagerDelegate* delegate) override; | 98 void Init(DisplayManagerDelegate* delegate) override; |
| 97 void SchedulePaint(const ServerView* view, const gfx::Rect& bounds) override; | 99 void SchedulePaint(const ServerView* view, const gfx::Rect& bounds) override; |
| 98 void SetViewportSize(const gfx::Size& size) override; | 100 void SetViewportSize(const gfx::Size& size) override; |
| 99 void SetTitle(const base::string16& title) override; | 101 void SetTitle(const base::string16& title) override; |
| 102 void SetCapture() override; |
| 100 const mojo::ViewportMetrics& GetViewportMetrics() override; | 103 const mojo::ViewportMetrics& GetViewportMetrics() override; |
| 101 void UpdateTextInputState(const ui::TextInputState& state) override; | 104 void UpdateTextInputState(const ui::TextInputState& state) override; |
| 102 void SetImeVisibility(bool visible) override; | 105 void SetImeVisibility(bool visible) override; |
| 103 | 106 |
| 104 private: | 107 private: |
| 105 void WantToDraw(); | 108 void WantToDraw(); |
| 106 void Draw(); | 109 void Draw(); |
| 107 void DidDraw(); | 110 void DidDraw(); |
| 108 void UpdateMetrics(const gfx::Size& size, float device_pixel_ratio); | 111 void UpdateMetrics(const gfx::Size& size, float device_pixel_ratio); |
| 109 | 112 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 134 scoped_ptr<ui::PlatformWindow> platform_window_; | 137 scoped_ptr<ui::PlatformWindow> platform_window_; |
| 135 | 138 |
| 136 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; | 139 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; |
| 137 | 140 |
| 138 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); | 141 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); |
| 139 }; | 142 }; |
| 140 | 143 |
| 141 } // namespace mus | 144 } // namespace mus |
| 142 | 145 |
| 143 #endif // COMPONENTS_MUS_DISPLAY_MANAGER_H_ | 146 #endif // COMPONENTS_MUS_DISPLAY_MANAGER_H_ |
| OLD | NEW |