| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 SKY_SHELL_PLATFORM_VIEW_H_ | 5 #ifndef SKY_SHELL_PLATFORM_VIEW_H_ |
| 6 #define SKY_SHELL_PLATFORM_VIEW_H_ | 6 #define SKY_SHELL_PLATFORM_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "sky/shell/ui_delegate.h" | 10 #include "sky/shell/ui_delegate.h" |
| 11 | 11 |
| 12 namespace sky { | 12 namespace sky { |
| 13 namespace shell { | 13 namespace shell { |
| 14 | 14 |
| 15 class PlatformView { | 15 class PlatformView { |
| 16 public: | 16 public: |
| 17 struct Config { | 17 struct Config { |
| 18 base::WeakPtr<UIDelegate> ui_delegate; | 18 base::WeakPtr<UIDelegate> ui_delegate; |
| 19 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner; | 19 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner; |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 explicit PlatformView(const Config& config); | 22 static PlatformView* Create(const Config& config); |
| 23 |
| 23 virtual ~PlatformView(); | 24 virtual ~PlatformView(); |
| 24 | 25 |
| 25 void ConnectToViewportObserver( | 26 void ConnectToViewportObserver( |
| 26 mojo::InterfaceRequest<ViewportObserver> request); | 27 mojo::InterfaceRequest<ViewportObserver> request); |
| 27 | 28 |
| 28 protected: | 29 protected: |
| 30 explicit PlatformView(const Config& config); |
| 31 |
| 29 void SurfaceWasCreated(); | 32 void SurfaceWasCreated(); |
| 30 void SurfaceWasDestroyed(); | 33 void SurfaceWasDestroyed(); |
| 31 | 34 |
| 32 Config config_; | 35 Config config_; |
| 33 gfx::AcceleratedWidget window_; | 36 gfx::AcceleratedWidget window_; |
| 34 | 37 |
| 35 private: | 38 private: |
| 36 DISALLOW_COPY_AND_ASSIGN(PlatformView); | 39 DISALLOW_COPY_AND_ASSIGN(PlatformView); |
| 37 }; | 40 }; |
| 38 | 41 |
| 39 } // namespace shell | 42 } // namespace shell |
| 40 } // namespace sky | 43 } // namespace sky |
| 41 | 44 |
| 42 #endif // SKY_SHELL_PLATFORM_VIEW_H_ | 45 #endif // SKY_SHELL_PLATFORM_VIEW_H_ |
| OLD | NEW |