| 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" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
| 13 #include "mojo/public/cpp/system/core.h" | 13 #include "mojo/public/cpp/system/core.h" |
| 14 #include "mojo/public/interfaces/application/service_provider.mojom.h" | 14 #include "mojo/public/interfaces/application/service_provider.mojom.h" |
| 15 #include "mojo/services/navigation/public/interfaces/navigation.mojom.h" | 15 #include "mojo/services/navigation/public/interfaces/navigation.mojom.h" |
| 16 #include "skia/ext/refptr.h" | 16 #include "skia/ext/refptr.h" |
| 17 #include "sky/engine/public/platform/ServiceProvider.h" | 17 #include "sky/engine/public/platform/ServiceProvider.h" |
| 18 #include "sky/engine/public/sky/sky_view.h" | 18 #include "sky/engine/public/sky/sky_view.h" |
| 19 #include "sky/engine/public/sky/sky_view_client.h" |
| 19 #include "sky/engine/public/web/WebFrameClient.h" | 20 #include "sky/engine/public/web/WebFrameClient.h" |
| 20 #include "sky/engine/public/web/WebViewClient.h" | 21 #include "sky/engine/public/web/WebViewClient.h" |
| 21 #include "sky/shell/gpu_delegate.h" | 22 #include "sky/shell/gpu_delegate.h" |
| 22 #include "sky/shell/ui_delegate.h" | 23 #include "sky/shell/ui_delegate.h" |
| 23 #include "sky/shell/service_provider.h" | 24 #include "sky/shell/service_provider.h" |
| 24 #include "third_party/skia/include/core/SkPicture.h" | 25 #include "third_party/skia/include/core/SkPicture.h" |
| 25 #include "ui/gfx/geometry/size.h" | 26 #include "ui/gfx/geometry/size.h" |
| 26 | 27 |
| 27 namespace sky { | 28 namespace sky { |
| 28 class PlatformImpl; | 29 class PlatformImpl; |
| 29 namespace shell { | 30 namespace shell { |
| 30 class Animator; | 31 class Animator; |
| 31 | 32 |
| 32 class Engine : public UIDelegate, | 33 class Engine : public UIDelegate, |
| 33 public ViewportObserver, | 34 public ViewportObserver, |
| 34 public blink::ServiceProvider, | 35 public blink::ServiceProvider, |
| 35 public mojo::NavigatorHost, | 36 public mojo::NavigatorHost, |
| 36 public blink::WebFrameClient, | 37 public blink::WebFrameClient, |
| 37 public blink::WebViewClient { | 38 public blink::WebViewClient, |
| 39 public blink::SkyViewClient { |
| 38 public: | 40 public: |
| 39 struct Config { | 41 struct Config { |
| 40 ServiceProviderContext* service_provider_context; | 42 ServiceProviderContext* service_provider_context; |
| 41 | 43 |
| 42 base::WeakPtr<GPUDelegate> gpu_delegate; | 44 base::WeakPtr<GPUDelegate> gpu_delegate; |
| 43 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner; | 45 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner; |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 explicit Engine(const Config& config); | 48 explicit Engine(const Config& config); |
| 47 ~Engine() override; | 49 ~Engine() override; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 68 | 70 |
| 69 // WebViewClient methods: | 71 // WebViewClient methods: |
| 70 void frameDetached(blink::WebFrame*) override; | 72 void frameDetached(blink::WebFrame*) override; |
| 71 void initializeLayerTreeView() override; | 73 void initializeLayerTreeView() override; |
| 72 void scheduleVisualUpdate() override; | 74 void scheduleVisualUpdate() override; |
| 73 blink::WebScreenInfo screenInfo() override; | 75 blink::WebScreenInfo screenInfo() override; |
| 74 blink::ServiceProvider* services() override; | 76 blink::ServiceProvider* services() override; |
| 75 void didCreateIsolate(blink::WebLocalFrame* frame, | 77 void didCreateIsolate(blink::WebLocalFrame* frame, |
| 76 Dart_Isolate isolate) override; | 78 Dart_Isolate isolate) override; |
| 77 | 79 |
| 80 // SkyViewClient methods: |
| 81 void SchedulePaint() override; |
| 82 |
| 78 // Services methods: | 83 // Services methods: |
| 79 mojo::NavigatorHost* NavigatorHost() override; | 84 mojo::NavigatorHost* NavigatorHost() override; |
| 80 | 85 |
| 81 // NavigatorHost methods: | 86 // NavigatorHost methods: |
| 82 void RequestNavigate(mojo::Target target, | 87 void RequestNavigate(mojo::Target target, |
| 83 mojo::URLRequestPtr request) override; | 88 mojo::URLRequestPtr request) override; |
| 84 void DidNavigateLocally(const mojo::String& url) override; | 89 void DidNavigateLocally(const mojo::String& url) override; |
| 85 void RequestNavigateHistory(int32_t delta) override; | 90 void RequestNavigateHistory(int32_t delta) override; |
| 86 | 91 |
| 87 void UpdateWebViewSize(); | 92 void UpdateWebViewSize(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 100 | 105 |
| 101 base::WeakPtrFactory<Engine> weak_factory_; | 106 base::WeakPtrFactory<Engine> weak_factory_; |
| 102 | 107 |
| 103 DISALLOW_COPY_AND_ASSIGN(Engine); | 108 DISALLOW_COPY_AND_ASSIGN(Engine); |
| 104 }; | 109 }; |
| 105 | 110 |
| 106 } // namespace shell | 111 } // namespace shell |
| 107 } // namespace sky | 112 } // namespace sky |
| 108 | 113 |
| 109 #endif // SKY_SHELL_UI_ENGINE_H_ | 114 #endif // SKY_SHELL_UI_ENGINE_H_ |
| OLD | NEW |