| 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/compiler_specific.h" | 8 #include "base/compiler_specific.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" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace base { | 25 namespace base { |
| 26 class MessageLoopProxy; | 26 class MessageLoopProxy; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace mojo { | 29 namespace mojo { |
| 30 class ViewManager; | 30 class ViewManager; |
| 31 class View; | 31 class View; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace inspector { |
| 35 class InspectorBackendMojo; |
| 36 } |
| 37 |
| 34 namespace sky { | 38 namespace sky { |
| 39 class InspectorHostImpl; |
| 35 class ScriptRunner; | 40 class ScriptRunner; |
| 36 class WebLayerTreeViewImpl; | 41 class WebLayerTreeViewImpl; |
| 37 | 42 |
| 38 class DocumentView : public mojo::InterfaceImpl<mojo::Application>, | 43 class DocumentView : public mojo::InterfaceImpl<mojo::Application>, |
| 39 public blink::ServiceProvider, | 44 public blink::ServiceProvider, |
| 40 public blink::WebViewClient, | 45 public blink::WebViewClient, |
| 41 public blink::WebFrameClient, | 46 public blink::WebFrameClient, |
| 42 public mojo::ViewManagerDelegate, | 47 public mojo::ViewManagerDelegate, |
| 43 public mojo::ViewObserver { | 48 public mojo::ViewObserver { |
| 44 public: | 49 public: |
| 45 // Load a new HTMLDocument with |response|. | 50 // Load a new HTMLDocument with |response|. |
| 46 // | 51 // |
| 47 // |shell| is the Shell connection for this mojo::Application. | 52 // |shell| is the Shell connection for this mojo::Application. |
| 48 DocumentView(mojo::URLResponsePtr response, | 53 DocumentView(mojo::URLResponsePtr response, |
| 49 mojo::ShellPtr shell, | 54 mojo::ShellPtr shell, |
| 50 scoped_refptr<base::MessageLoopProxy> compositor_thread); | 55 scoped_refptr<base::MessageLoopProxy> compositor_thread); |
| 51 virtual ~DocumentView(); | 56 virtual ~DocumentView(); |
| 52 | 57 |
| 53 base::WeakPtr<DocumentView> GetWeakPtr(); | 58 base::WeakPtr<DocumentView> GetWeakPtr(); |
| 54 | 59 |
| 55 blink::WebView* web_view() const { return web_view_; } | 60 blink::WebView* web_view() const { return web_view_; } |
| 56 mojo::ServiceProvider* imported_services() const { | 61 mojo::ServiceProvider* imported_services() const { |
| 57 return imported_services_.get(); | 62 return imported_services_.get(); |
| 58 } | 63 } |
| 59 | 64 |
| 60 mojo::Shell* shell() const { return shell_.get(); } | 65 mojo::Shell* shell() const { return shell_.get(); } |
| 61 | 66 |
| 67 void StartDebuggerInspectorBackend(); |
| 68 |
| 62 private: | 69 private: |
| 63 // Application methods: | 70 // Application methods: |
| 64 void AcceptConnection(const mojo::String& requestor_url, | 71 void AcceptConnection(const mojo::String& requestor_url, |
| 65 mojo::ServiceProviderPtr provider) override; | 72 mojo::ServiceProviderPtr provider) override; |
| 66 void Initialize(mojo::Array<mojo::String> args) override; | 73 void Initialize(mojo::Array<mojo::String> args) override; |
| 67 | 74 |
| 68 // WebWidgetClient methods: | 75 // WebWidgetClient methods: |
| 69 blink::WebLayerTreeView* initializeLayerTreeView() override; | 76 blink::WebLayerTreeView* initializeLayerTreeView() override; |
| 70 void scheduleAnimation() override; | 77 void scheduleAnimation() override; |
| 71 | 78 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 scoped_ptr<mojo::ServiceProvider> imported_services_; | 123 scoped_ptr<mojo::ServiceProvider> imported_services_; |
| 117 mojo::ShellPtr shell_; | 124 mojo::ShellPtr shell_; |
| 118 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; | 125 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; |
| 119 blink::WebView* web_view_; | 126 blink::WebView* web_view_; |
| 120 mojo::View* root_; | 127 mojo::View* root_; |
| 121 mojo::ViewManagerClientFactory view_manager_client_factory_; | 128 mojo::ViewManagerClientFactory view_manager_client_factory_; |
| 122 InspectorServiceFactory inspector_service_factory_; | 129 InspectorServiceFactory inspector_service_factory_; |
| 123 scoped_ptr<WebLayerTreeViewImpl> web_layer_tree_view_impl_; | 130 scoped_ptr<WebLayerTreeViewImpl> web_layer_tree_view_impl_; |
| 124 scoped_refptr<base::MessageLoopProxy> compositor_thread_; | 131 scoped_refptr<base::MessageLoopProxy> compositor_thread_; |
| 125 scoped_ptr<ScriptRunner> script_runner_; | 132 scoped_ptr<ScriptRunner> script_runner_; |
| 133 scoped_ptr<InspectorHostImpl> inspector_host_; |
| 134 scoped_ptr<inspector::InspectorBackendMojo> inspector_backend_; |
| 126 int debugger_id_; | 135 int debugger_id_; |
| 127 | 136 |
| 128 base::WeakPtrFactory<DocumentView> weak_factory_; | 137 base::WeakPtrFactory<DocumentView> weak_factory_; |
| 129 DISALLOW_COPY_AND_ASSIGN(DocumentView); | 138 DISALLOW_COPY_AND_ASSIGN(DocumentView); |
| 130 }; | 139 }; |
| 131 | 140 |
| 132 } // namespace sky | 141 } // namespace sky |
| 133 | 142 |
| 134 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_ | 143 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_ |
| OLD | NEW |