| OLD | NEW |
| 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/interfaces/application/application.mojom.h" | 13 #include "mojo/public/interfaces/application/application.mojom.h" |
| 14 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.
h" | 14 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.
h" |
| 15 #include "mojo/services/navigation/public/interfaces/navigation.mojom.h" | 15 #include "mojo/services/navigation/public/interfaces/navigation.mojom.h" |
| 16 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 16 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
| 17 #include "mojo/services/view_manager/public/cpp/view_manager_client_factory.h" | 17 #include "mojo/services/view_manager/public/cpp/view_manager_client_factory.h" |
| 18 #include "mojo/services/view_manager/public/cpp/view_manager_delegate.h" | 18 #include "mojo/services/view_manager/public/cpp/view_manager_delegate.h" |
| 19 #include "mojo/services/view_manager/public/cpp/view_observer.h" | 19 #include "mojo/services/view_manager/public/cpp/view_observer.h" |
| 20 #include "sky/compositor/layer_client.h" | 20 #include "sky/compositor/layer_client.h" |
| 21 #include "sky/compositor/layer_host_client.h" | 21 #include "sky/compositor/layer_host_client.h" |
| 22 #include "sky/engine/public/platform/ServiceProvider.h" | 22 #include "sky/engine/public/platform/ServiceProvider.h" |
| 23 #include "sky/engine/public/web/WebFrameClient.h" | 23 #include "sky/engine/public/web/WebFrameClient.h" |
| 24 #include "sky/engine/public/web/WebViewClient.h" | 24 #include "sky/engine/public/web/WebViewClient.h" |
| 25 #include "sky/viewer/services/inspector_impl.h" | |
| 26 #include "ui/events/gestures/gesture_types.h" | 25 #include "ui/events/gestures/gesture_types.h" |
| 27 | 26 |
| 28 namespace mojo { | 27 namespace mojo { |
| 29 class ViewManager; | 28 class ViewManager; |
| 30 class View; | 29 class View; |
| 31 } | 30 } |
| 32 | 31 |
| 33 namespace inspector { | |
| 34 class InspectorBackendMojo; | |
| 35 } | |
| 36 | |
| 37 namespace sky { | 32 namespace sky { |
| 38 class InspectorHostImpl; | |
| 39 class Rasterizer; | 33 class Rasterizer; |
| 40 class RasterizerBitmap; | 34 class RasterizerBitmap; |
| 41 class ScriptRunner; | |
| 42 class Layer; | 35 class Layer; |
| 43 class LayerHost; | 36 class LayerHost; |
| 44 | 37 |
| 45 class DocumentView : public blink::ServiceProvider, | 38 class DocumentView : public blink::ServiceProvider, |
| 46 public blink::WebFrameClient, | 39 public blink::WebFrameClient, |
| 47 public blink::WebViewClient, | 40 public blink::WebViewClient, |
| 48 public mojo::ViewManagerDelegate, | 41 public mojo::ViewManagerDelegate, |
| 49 public mojo::ViewObserver, | 42 public mojo::ViewObserver, |
| 50 public sky::LayerClient, | 43 public sky::LayerClient, |
| 51 public sky::LayerHostClient, | 44 public sky::LayerHostClient, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // WebFrameClient methods: | 79 // WebFrameClient methods: |
| 87 mojo::View* createChildFrame() override; | 80 mojo::View* createChildFrame() override; |
| 88 void frameDetached(blink::WebFrame*) override; | 81 void frameDetached(blink::WebFrame*) override; |
| 89 blink::WebNavigationPolicy decidePolicyForNavigation( | 82 blink::WebNavigationPolicy decidePolicyForNavigation( |
| 90 const blink::WebFrameClient::NavigationPolicyInfo& info) override; | 83 const blink::WebFrameClient::NavigationPolicyInfo& info) override; |
| 91 void didAddMessageToConsole( | 84 void didAddMessageToConsole( |
| 92 const blink::WebConsoleMessage& message, | 85 const blink::WebConsoleMessage& message, |
| 93 const blink::WebString& source_name, | 86 const blink::WebString& source_name, |
| 94 unsigned source_line, | 87 unsigned source_line, |
| 95 const blink::WebString& stack_trace) override; | 88 const blink::WebString& stack_trace) override; |
| 96 void didCreateScriptContext( | 89 void didCreateIsolate(blink::WebLocalFrame* frame, |
| 97 blink::WebLocalFrame*, | 90 Dart_Isolate isolate) override; |
| 98 v8::Handle<v8::Context>) override; | |
| 99 | 91 |
| 100 // WebViewClient methods: | 92 // WebViewClient methods: |
| 101 blink::ServiceProvider* services() override; | 93 blink::ServiceProvider* services() override; |
| 102 | 94 |
| 103 // Services methods: | 95 // Services methods: |
| 104 mojo::NavigatorHost* NavigatorHost() override; | 96 mojo::NavigatorHost* NavigatorHost() override; |
| 105 | 97 |
| 106 // ViewManagerDelegate methods: | 98 // ViewManagerDelegate methods: |
| 107 void OnEmbed(mojo::View* root, | 99 void OnEmbed(mojo::View* root, |
| 108 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 100 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 129 void UpdateRootSizeAndViewportMetrics(const mojo::Rect& new_bounds); | 121 void UpdateRootSizeAndViewportMetrics(const mojo::Rect& new_bounds); |
| 130 | 122 |
| 131 mojo::URLResponsePtr response_; | 123 mojo::URLResponsePtr response_; |
| 132 mojo::ServiceProviderImpl exported_services_; | 124 mojo::ServiceProviderImpl exported_services_; |
| 133 mojo::ServiceProviderPtr imported_services_; | 125 mojo::ServiceProviderPtr imported_services_; |
| 134 mojo::Shell* shell_; | 126 mojo::Shell* shell_; |
| 135 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; | 127 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; |
| 136 blink::WebView* web_view_; | 128 blink::WebView* web_view_; |
| 137 mojo::View* root_; | 129 mojo::View* root_; |
| 138 mojo::ViewManagerClientFactory view_manager_client_factory_; | 130 mojo::ViewManagerClientFactory view_manager_client_factory_; |
| 139 InspectorServiceFactory inspector_service_factory_; | |
| 140 mojo::ServiceProviderImpl inspector_service_provider_impl_; | |
| 141 scoped_ptr<LayerHost> layer_host_; | 131 scoped_ptr<LayerHost> layer_host_; |
| 142 scoped_refptr<Layer> root_layer_; | 132 scoped_refptr<Layer> root_layer_; |
| 143 RasterizerBitmap* bitmap_rasterizer_; // Used for pixel tests. | 133 RasterizerBitmap* bitmap_rasterizer_; // Used for pixel tests. |
| 144 scoped_ptr<ScriptRunner> script_runner_; | |
| 145 scoped_ptr<InspectorHostImpl> inspector_host_; | |
| 146 scoped_ptr<inspector::InspectorBackendMojo> inspector_backend_; | |
| 147 int debugger_id_; | |
| 148 | 134 |
| 149 base::WeakPtrFactory<DocumentView> weak_factory_; | 135 base::WeakPtrFactory<DocumentView> weak_factory_; |
| 150 | 136 |
| 151 DISALLOW_COPY_AND_ASSIGN(DocumentView); | 137 DISALLOW_COPY_AND_ASSIGN(DocumentView); |
| 152 }; | 138 }; |
| 153 | 139 |
| 154 } // namespace sky | 140 } // namespace sky |
| 155 | 141 |
| 156 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_ | 142 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_ |
| OLD | NEW |