| 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/asset_bundle/public/interfaces/asset_bundle.mojom.h" |
| 15 #include "mojo/services/navigation/public/interfaces/navigation.mojom.h" | 16 #include "mojo/services/navigation/public/interfaces/navigation.mojom.h" |
| 16 #include "skia/ext/refptr.h" | 17 #include "skia/ext/refptr.h" |
| 17 #include "sky/engine/public/platform/ServiceProvider.h" | 18 #include "sky/engine/public/platform/ServiceProvider.h" |
| 18 #include "sky/engine/public/sky/sky_view.h" | 19 #include "sky/engine/public/sky/sky_view.h" |
| 19 #include "sky/engine/public/sky/sky_view_client.h" | 20 #include "sky/engine/public/sky/sky_view_client.h" |
| 20 #include "sky/shell/gpu_delegate.h" | 21 #include "sky/shell/gpu_delegate.h" |
| 21 #include "sky/shell/ui_delegate.h" | 22 #include "sky/shell/ui_delegate.h" |
| 22 #include "sky/shell/service_provider.h" | 23 #include "sky/shell/service_provider.h" |
| 23 #include "third_party/skia/include/core/SkPicture.h" | 24 #include "third_party/skia/include/core/SkPicture.h" |
| 24 #include "ui/gfx/geometry/size.h" | 25 #include "ui/gfx/geometry/size.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 63 |
| 63 // SkyEngine implementation: | 64 // SkyEngine implementation: |
| 64 void OnViewportMetricsChanged(int width, int height, | 65 void OnViewportMetricsChanged(int width, int height, |
| 65 float device_pixel_ratio) override; | 66 float device_pixel_ratio) override; |
| 66 void OnInputEvent(InputEventPtr event) override; | 67 void OnInputEvent(InputEventPtr event) override; |
| 67 | 68 |
| 68 void RunFromNetwork(const mojo::String& url) override; | 69 void RunFromNetwork(const mojo::String& url) override; |
| 69 void RunFromFile(const mojo::String& main, | 70 void RunFromFile(const mojo::String& main, |
| 70 const mojo::String& package_root) override; | 71 const mojo::String& package_root) override; |
| 71 void RunFromSnapshot(const mojo::String& path) override; | 72 void RunFromSnapshot(const mojo::String& path) override; |
| 73 void RunFromBundle(const mojo::String& path) override; |
| 72 | 74 |
| 73 // SkyViewClient methods: | 75 // SkyViewClient methods: |
| 74 void ScheduleFrame() override; | 76 void ScheduleFrame() override; |
| 75 void DidCreateIsolate(Dart_Isolate isolate) override; | 77 void DidCreateIsolate(Dart_Isolate isolate) override; |
| 76 | 78 |
| 77 // Services methods: | 79 // Services methods: |
| 78 mojo::NavigatorHost* NavigatorHost() override; | 80 mojo::NavigatorHost* NavigatorHost() override; |
| 79 | 81 |
| 80 // NavigatorHost methods: | 82 // NavigatorHost methods: |
| 81 void RequestNavigate(mojo::Target target, | 83 void RequestNavigate(mojo::Target target, |
| 82 mojo::URLRequestPtr request) override; | 84 mojo::URLRequestPtr request) override; |
| 83 void DidNavigateLocally(const mojo::String& url) override; | 85 void DidNavigateLocally(const mojo::String& url) override; |
| 84 void RequestNavigateHistory(int32_t delta) override; | 86 void RequestNavigateHistory(int32_t delta) override; |
| 85 | 87 |
| 86 void RunFromLibrary(const mojo::String& name); | 88 void RunFromLibrary(const std::string& name); |
| 89 void RunFromSnapshotStream(const std::string& name, |
| 90 mojo::ScopedDataPipeConsumerHandle snapshot); |
| 87 | 91 |
| 88 void UpdateSkyViewSize(); | 92 void UpdateSkyViewSize(); |
| 89 | 93 |
| 90 Config config_; | 94 Config config_; |
| 91 scoped_ptr<Animator> animator_; | 95 scoped_ptr<Animator> animator_; |
| 92 | 96 |
| 97 mojo::asset_bundle::AssetBundlePtr root_bundle_; |
| 93 scoped_ptr<blink::DartLibraryProvider> dart_library_provider_; | 98 scoped_ptr<blink::DartLibraryProvider> dart_library_provider_; |
| 94 std::unique_ptr<blink::SkyView> sky_view_; | 99 std::unique_ptr<blink::SkyView> sky_view_; |
| 95 | 100 |
| 96 float device_pixel_ratio_; | 101 float device_pixel_ratio_; |
| 97 gfx::Size physical_size_; | 102 gfx::Size physical_size_; |
| 98 mojo::Binding<SkyEngine> binding_; | 103 mojo::Binding<SkyEngine> binding_; |
| 99 | 104 |
| 100 base::WeakPtrFactory<Engine> weak_factory_; | 105 base::WeakPtrFactory<Engine> weak_factory_; |
| 101 | 106 |
| 102 DISALLOW_COPY_AND_ASSIGN(Engine); | 107 DISALLOW_COPY_AND_ASSIGN(Engine); |
| 103 }; | 108 }; |
| 104 | 109 |
| 105 } // namespace shell | 110 } // namespace shell |
| 106 } // namespace sky | 111 } // namespace sky |
| 107 | 112 |
| 108 #endif // SKY_SHELL_UI_ENGINE_H_ | 113 #endif // SKY_SHELL_UI_ENGINE_H_ |
| OLD | NEW |