Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1266)

Side by Side Diff: sky/viewer/document_view.h

Issue 1147413003: Teach sky_viewer about the new main.dart hotness (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Turn off SkyView by defaultw Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/public/sky/sky_view.cc ('k') | sky/viewer/document_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_VIEWER_DOCUMENT_VIEW_H_ 5 #ifndef SKY_VIEWER_DOCUMENT_VIEW_H_
6 #define SKY_VIEWER_DOCUMENT_VIEW_H_ 6 #define SKY_VIEWER_DOCUMENT_VIEW_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "mojo/public/cpp/application/lazy_interface_ptr.h" 10 #include "mojo/public/cpp/application/lazy_interface_ptr.h"
11 #include "mojo/public/cpp/application/service_provider_impl.h" 11 #include "mojo/public/cpp/application/service_provider_impl.h"
12 #include "mojo/public/cpp/bindings/interface_impl.h" 12 #include "mojo/public/cpp/bindings/interface_impl.h"
13 #include "mojo/public/cpp/bindings/strong_binding.h" 13 #include "mojo/public/cpp/bindings/strong_binding.h"
14 #include "mojo/public/interfaces/application/application.mojom.h" 14 #include "mojo/public/interfaces/application/application.mojom.h"
15 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom. h" 15 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom. h"
16 #include "mojo/services/navigation/public/interfaces/navigation.mojom.h" 16 #include "mojo/services/navigation/public/interfaces/navigation.mojom.h"
17 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" 17 #include "mojo/services/network/public/interfaces/url_loader.mojom.h"
18 #include "mojo/services/service_registry/public/interfaces/service_registry.mojo m.h" 18 #include "mojo/services/service_registry/public/interfaces/service_registry.mojo m.h"
19 #include "mojo/services/view_manager/public/cpp/view_manager_client_factory.h" 19 #include "mojo/services/view_manager/public/cpp/view_manager_client_factory.h"
20 #include "mojo/services/view_manager/public/cpp/view_manager_delegate.h" 20 #include "mojo/services/view_manager/public/cpp/view_manager_delegate.h"
21 #include "mojo/services/view_manager/public/cpp/view_observer.h" 21 #include "mojo/services/view_manager/public/cpp/view_observer.h"
22 #include "sky/compositor/layer_client.h" 22 #include "sky/compositor/layer_client.h"
23 #include "sky/compositor/layer_host_client.h" 23 #include "sky/compositor/layer_host_client.h"
24 #include "sky/engine/public/platform/ServiceProvider.h" 24 #include "sky/engine/public/platform/ServiceProvider.h"
25 #include "sky/engine/public/sky/sky_view.h"
26 #include "sky/engine/public/sky/sky_view_client.h"
25 #include "sky/engine/public/web/WebFrameClient.h" 27 #include "sky/engine/public/web/WebFrameClient.h"
26 #include "sky/engine/public/web/WebViewClient.h" 28 #include "sky/engine/public/web/WebViewClient.h"
27 #include "sky/services/testing/test_harness.mojom.h" 29 #include "sky/services/testing/test_harness.mojom.h"
28 #include "ui/events/gestures/gesture_types.h" 30 #include "ui/events/gestures/gesture_types.h"
29 31
32
30 namespace mojo { 33 namespace mojo {
31 class ViewManager; 34 class ViewManager;
32 class View; 35 class View;
33 } 36 }
34 37
35 namespace sky { 38 namespace sky {
36 class Rasterizer; 39 class Rasterizer;
37 class RasterizerBitmap; 40 class RasterizerBitmap;
38 class Layer; 41 class Layer;
39 class LayerHost; 42 class LayerHost;
40 43
41 class DocumentView : public blink::ServiceProvider, 44 class DocumentView : public blink::ServiceProvider,
42 public blink::WebFrameClient, 45 public blink::WebFrameClient,
43 public blink::WebViewClient, 46 public blink::WebViewClient,
47 public blink::SkyViewClient,
44 public mojo::ViewManagerDelegate, 48 public mojo::ViewManagerDelegate,
45 public mojo::ViewObserver, 49 public mojo::ViewObserver,
46 public sky::LayerClient, 50 public sky::LayerClient,
47 public sky::LayerHostClient, 51 public sky::LayerHostClient,
48 public ui::GestureConsumer { 52 public ui::GestureConsumer {
49 public: 53 public:
50 DocumentView(mojo::InterfaceRequest<mojo::ServiceProvider> services, 54 DocumentView(mojo::InterfaceRequest<mojo::ServiceProvider> services,
51 mojo::ServiceProviderPtr exported_services, 55 mojo::ServiceProviderPtr exported_services,
52 mojo::URLResponsePtr response, 56 mojo::URLResponsePtr response,
53 mojo::Shell* shell); 57 mojo::Shell* shell);
54 ~DocumentView() override; 58 ~DocumentView() override;
55 59
56 base::WeakPtr<DocumentView> GetWeakPtr(); 60 base::WeakPtr<DocumentView> GetWeakPtr();
57 61
58 blink::WebView* web_view() const { return web_view_; } 62 blink::WebView* web_view() const { return web_view_; }
59 63
60 mojo::Shell* shell() const { return shell_; } 64 mojo::Shell* shell() const { return shell_; }
61 65
62 // sky::LayerHostClient 66 // sky::LayerHostClient
63 mojo::Shell* GetShell() override; 67 mojo::Shell* GetShell() override;
64 void BeginFrame(base::TimeTicks frame_time) override; 68 void BeginFrame(base::TimeTicks frame_time) override;
65 void OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) override; 69 void OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) override;
66 // sky::LayerClient 70 // sky::LayerClient
67 void PaintContents(SkCanvas* canvas, const gfx::Rect& clip) override; 71 void PaintContents(SkCanvas* canvas, const gfx::Rect& clip) override;
68 72
73 // SkyViewClient methods:
74 void ScheduleFrame() override;
75
69 void StartDebuggerInspectorBackend(); 76 void StartDebuggerInspectorBackend();
70 77
71 void GetPixelsForTesting(std::vector<unsigned char>* pixels); 78 void GetPixelsForTesting(std::vector<unsigned char>* pixels);
72 79
73 TestHarnessPtr TakeTestHarness(); 80 TestHarnessPtr TakeTestHarness();
74 mojo::ScopedMessagePipeHandle TakeServicesProvidedToEmbedder(); 81 mojo::ScopedMessagePipeHandle TakeServicesProvidedToEmbedder();
75 mojo::ScopedMessagePipeHandle TakeServicesProvidedByEmbedder(); 82 mojo::ScopedMessagePipeHandle TakeServicesProvidedByEmbedder();
76 mojo::ScopedMessagePipeHandle TakeServiceRegistry(); 83 mojo::ScopedMessagePipeHandle TakeServiceRegistry();
77 84
78 private: 85 private:
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void InitServiceRegistry(); 135 void InitServiceRegistry();
129 136
130 mojo::URLResponsePtr response_; 137 mojo::URLResponsePtr response_;
131 mojo::ServiceProviderImpl exported_services_; 138 mojo::ServiceProviderImpl exported_services_;
132 mojo::ServiceProviderPtr imported_services_; 139 mojo::ServiceProviderPtr imported_services_;
133 mojo::InterfaceRequest<mojo::ServiceProvider> services_provided_to_embedder_; 140 mojo::InterfaceRequest<mojo::ServiceProvider> services_provided_to_embedder_;
134 mojo::ServiceProviderPtr services_provided_by_embedder_; 141 mojo::ServiceProviderPtr services_provided_by_embedder_;
135 mojo::Shell* shell_; 142 mojo::Shell* shell_;
136 TestHarnessPtr test_harness_; 143 TestHarnessPtr test_harness_;
137 mojo::NavigatorHostPtr navigator_host_; 144 mojo::NavigatorHostPtr navigator_host_;
145 std::unique_ptr<blink::SkyView> sky_view_;
138 blink::WebView* web_view_; 146 blink::WebView* web_view_;
139 mojo::View* root_; 147 mojo::View* root_;
140 mojo::ViewManagerClientFactory view_manager_client_factory_; 148 mojo::ViewManagerClientFactory view_manager_client_factory_;
141 scoped_ptr<LayerHost> layer_host_; 149 scoped_ptr<LayerHost> layer_host_;
142 scoped_refptr<Layer> root_layer_; 150 scoped_refptr<Layer> root_layer_;
143 RasterizerBitmap* bitmap_rasterizer_; // Used for pixel tests. 151 RasterizerBitmap* bitmap_rasterizer_; // Used for pixel tests.
144 mojo::ServiceRegistryPtr service_registry_; 152 mojo::ServiceRegistryPtr service_registry_;
145 scoped_ptr<mojo::StrongBinding<mojo::ServiceProvider>> 153 scoped_ptr<mojo::StrongBinding<mojo::ServiceProvider>>
146 service_registry_service_provider_binding_; 154 service_registry_service_provider_binding_;
147 base::WeakPtrFactory<DocumentView> weak_factory_; 155 base::WeakPtrFactory<DocumentView> weak_factory_;
148 156
149 DISALLOW_COPY_AND_ASSIGN(DocumentView); 157 DISALLOW_COPY_AND_ASSIGN(DocumentView);
150 }; 158 };
151 159
152 } // namespace sky 160 } // namespace sky
153 161
154 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_ 162 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_
OLDNEW
« no previous file with comments | « sky/engine/public/sky/sky_view.cc ('k') | sky/viewer/document_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698