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_UI_ENGINE_H_ | 5 #ifndef SKY_SHELL_UI_ENGINE_H_ |
6 #define SKY_SHELL_UI_ENGINE_H_ | 6 #define SKY_SHELL_UI_ENGINE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class Animator; | 28 class Animator; |
29 | 29 |
30 class Engine : public UIDelegate, | 30 class Engine : public UIDelegate, |
31 public ViewportObserver, | 31 public ViewportObserver, |
32 public blink::ServiceProvider, | 32 public blink::ServiceProvider, |
33 public mojo::NavigatorHost, | 33 public mojo::NavigatorHost, |
34 public blink::WebFrameClient, | 34 public blink::WebFrameClient, |
35 public blink::WebViewClient { | 35 public blink::WebViewClient { |
36 public: | 36 public: |
37 struct Config { | 37 struct Config { |
| 38 scoped_refptr<base::SingleThreadTaskRunner> java_task_runner; |
| 39 |
38 base::WeakPtr<GPUDelegate> gpu_delegate; | 40 base::WeakPtr<GPUDelegate> gpu_delegate; |
39 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner; | 41 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner; |
40 }; | 42 }; |
41 | 43 |
42 explicit Engine(const Config& config); | 44 explicit Engine(const Config& config); |
43 ~Engine() override; | 45 ~Engine() override; |
44 | 46 |
45 base::WeakPtr<Engine> GetWeakPtr(); | 47 base::WeakPtr<Engine> GetWeakPtr(); |
46 | 48 |
47 void Init(mojo::ScopedMessagePipeHandle service_provider); | 49 void Init(); |
48 | 50 |
49 void BeginFrame(base::TimeTicks frame_time); | 51 void BeginFrame(base::TimeTicks frame_time); |
50 skia::RefPtr<SkPicture> Paint(); | 52 skia::RefPtr<SkPicture> Paint(); |
51 | 53 |
52 private: | 54 private: |
53 // UIDelegate methods: | 55 // UIDelegate methods: |
54 void ConnectToViewportObserver( | 56 void ConnectToViewportObserver( |
55 mojo::InterfaceRequest<ViewportObserver> request) override; | 57 mojo::InterfaceRequest<ViewportObserver> request) override; |
56 | 58 |
57 // ViewportObserver: | 59 // ViewportObserver: |
(...skipping 13 matching lines...) Expand all Loading... |
71 | 73 |
72 // Services methods: | 74 // Services methods: |
73 mojo::NavigatorHost* NavigatorHost() override; | 75 mojo::NavigatorHost* NavigatorHost() override; |
74 | 76 |
75 // NavigatorHost methods: | 77 // NavigatorHost methods: |
76 void RequestNavigate(mojo::Target target, | 78 void RequestNavigate(mojo::Target target, |
77 mojo::URLRequestPtr request) override; | 79 mojo::URLRequestPtr request) override; |
78 void DidNavigateLocally(const mojo::String& url) override; | 80 void DidNavigateLocally(const mojo::String& url) override; |
79 void RequestNavigateHistory(int32_t delta) override; | 81 void RequestNavigateHistory(int32_t delta) override; |
80 | 82 |
| 83 mojo::ServiceProviderPtr CreateServiceProvider(); |
81 void UpdateWebViewSize(); | 84 void UpdateWebViewSize(); |
82 | 85 |
| 86 scoped_refptr<base::SingleThreadTaskRunner> java_task_runner_; |
83 mojo::ServiceProviderPtr service_provider_; | 87 mojo::ServiceProviderPtr service_provider_; |
84 scoped_ptr<PlatformImpl> platform_impl_; | 88 scoped_ptr<PlatformImpl> platform_impl_; |
85 scoped_ptr<Animator> animator_; | 89 scoped_ptr<Animator> animator_; |
86 blink::WebView* web_view_; | 90 blink::WebView* web_view_; |
87 float device_pixel_ratio_; | 91 float device_pixel_ratio_; |
88 gfx::Size physical_size_; | 92 gfx::Size physical_size_; |
89 mojo::Binding<ViewportObserver> viewport_observer_binding_; | 93 mojo::Binding<ViewportObserver> viewport_observer_binding_; |
90 | 94 |
91 base::WeakPtrFactory<Engine> weak_factory_; | 95 base::WeakPtrFactory<Engine> weak_factory_; |
92 | 96 |
93 DISALLOW_COPY_AND_ASSIGN(Engine); | 97 DISALLOW_COPY_AND_ASSIGN(Engine); |
94 }; | 98 }; |
95 | 99 |
96 } // namespace shell | 100 } // namespace shell |
97 } // namespace sky | 101 } // namespace sky |
98 | 102 |
99 #endif // SKY_SHELL_UI_ENGINE_H_ | 103 #endif // SKY_SHELL_UI_ENGINE_H_ |
OLD | NEW |