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_VIEW_MANAGER_DISPLAY_MANAGER_H_ | 5 #ifndef COMPONENTS_MUS_DISPLAY_MANAGER_H_ |
6 #define COMPONENTS_VIEW_MANAGER_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" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
14 #include "components/view_manager/display_manager_delegate.h" | 14 #include "components/mus/display_manager_delegate.h" |
15 #include "components/view_manager/public/interfaces/view_tree.mojom.h" | 15 #include "components/mus/public/interfaces/view_tree.mojom.h" |
16 #include "components/view_manager/surfaces/top_level_display_client.h" | 16 #include "components/mus/surfaces/top_level_display_client.h" |
17 #include "third_party/mojo/src/mojo/public/cpp/bindings/callback.h" | 17 #include "third_party/mojo/src/mojo/public/cpp/bindings/callback.h" |
18 #include "ui/gfx/geometry/rect.h" | 18 #include "ui/gfx/geometry/rect.h" |
19 #include "ui/platform_window/platform_window_delegate.h" | 19 #include "ui/platform_window/platform_window_delegate.h" |
20 | 20 |
21 namespace cc { | 21 namespace cc { |
22 class SurfaceIdAllocator; | 22 class SurfaceIdAllocator; |
23 class SurfaceManager; | 23 class SurfaceManager; |
24 } // namespace cc | 24 } // namespace cc |
25 | 25 |
26 namespace gles2 { | 26 namespace gles2 { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 DisplayManager::factory_ = factory; | 79 DisplayManager::factory_ = factory; |
80 } | 80 } |
81 | 81 |
82 private: | 82 private: |
83 // Static factory instance (always NULL for non-test). | 83 // Static factory instance (always NULL for non-test). |
84 static DisplayManagerFactory* factory_; | 84 static DisplayManagerFactory* factory_; |
85 }; | 85 }; |
86 | 86 |
87 // DisplayManager implementation that connects to the services necessary to | 87 // DisplayManager implementation that connects to the services necessary to |
88 // actually display. | 88 // actually display. |
89 class DefaultDisplayManager : | 89 class DefaultDisplayManager : public DisplayManager, |
90 public DisplayManager, | 90 public ui::PlatformWindowDelegate { |
91 public ui::PlatformWindowDelegate { | |
92 public: | 91 public: |
93 DefaultDisplayManager( | 92 DefaultDisplayManager( |
94 bool is_headless, | 93 bool is_headless, |
95 mojo::ApplicationImpl* app_impl, | 94 mojo::ApplicationImpl* app_impl, |
96 const scoped_refptr<gles2::GpuState>& gpu_state, | 95 const scoped_refptr<gles2::GpuState>& gpu_state, |
97 const scoped_refptr<surfaces::SurfacesState>& surfaces_state); | 96 const scoped_refptr<surfaces::SurfacesState>& surfaces_state); |
98 ~DefaultDisplayManager() override; | 97 ~DefaultDisplayManager() override; |
99 | 98 |
100 // DisplayManager: | 99 // DisplayManager: |
101 void Init(DisplayManagerDelegate* delegate) override; | 100 void Init(DisplayManagerDelegate* delegate) override; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 scoped_ptr<surfaces::TopLevelDisplayClient> top_level_display_client_; | 137 scoped_ptr<surfaces::TopLevelDisplayClient> top_level_display_client_; |
139 scoped_ptr<ui::PlatformWindow> platform_window_; | 138 scoped_ptr<ui::PlatformWindow> platform_window_; |
140 | 139 |
141 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; | 140 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; |
142 | 141 |
143 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); | 142 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); |
144 }; | 143 }; |
145 | 144 |
146 } // namespace view_manager | 145 } // namespace view_manager |
147 | 146 |
148 #endif // COMPONENTS_VIEW_MANAGER_DISPLAY_MANAGER_H_ | 147 #endif // COMPONENTS_MUS_DISPLAY_MANAGER_H_ |
OLD | NEW |