| 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 Config(); | 18 Config(); |
| 19 ~Config(); | 19 ~Config(); |
| 20 | 20 |
| 21 base::WeakPtr<UIDelegate> ui_delegate; | 21 base::WeakPtr<UIDelegate> ui_delegate; |
| 22 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner; | 22 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner; |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 static PlatformView* Create(const Config& config); | 25 static PlatformView* Create(const Config& config); |
| 26 | 26 |
| 27 virtual ~PlatformView(); | 27 virtual ~PlatformView(); |
| 28 | 28 |
| 29 void ConnectToViewportObserver( | 29 void ConnectToEngine(mojo::InterfaceRequest<SkyEngine> request); |
| 30 mojo::InterfaceRequest<ViewportObserver> request); | |
| 31 | 30 |
| 32 protected: | 31 protected: |
| 33 explicit PlatformView(const Config& config); | 32 explicit PlatformView(const Config& config); |
| 34 | 33 |
| 35 void SurfaceWasCreated(); | 34 void SurfaceWasCreated(); |
| 36 void SurfaceWasDestroyed(); | 35 void SurfaceWasDestroyed(); |
| 37 | 36 |
| 38 Config config_; | 37 Config config_; |
| 39 gfx::AcceleratedWidget window_; | 38 gfx::AcceleratedWidget window_; |
| 40 | 39 |
| 41 private: | 40 private: |
| 42 DISALLOW_COPY_AND_ASSIGN(PlatformView); | 41 DISALLOW_COPY_AND_ASSIGN(PlatformView); |
| 43 }; | 42 }; |
| 44 | 43 |
| 45 } // namespace shell | 44 } // namespace shell |
| 46 } // namespace sky | 45 } // namespace sky |
| 47 | 46 |
| 48 #endif // SKY_SHELL_PLATFORM_VIEW_H_ | 47 #endif // SKY_SHELL_PLATFORM_VIEW_H_ |
| OLD | NEW |