Chromium Code Reviews| Index: mojo/services/html_viewer/html_document_view.h |
| diff --git a/mojo/services/html_viewer/html_document_view.h b/mojo/services/html_viewer/html_document_view.h |
| index 52427af3eb384d69fbcb4ddfeda773fea5df5adc..f3e4a2cf8e744566a34751b31a937cadca263a28 100644 |
| --- a/mojo/services/html_viewer/html_document_view.h |
| +++ b/mojo/services/html_viewer/html_document_view.h |
| @@ -8,7 +8,10 @@ |
| #include "base/compiler_specific.h" |
| #include "base/memory/weak_ptr.h" |
| #include "mojo/public/cpp/application/lazy_interface_ptr.h" |
| +#include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h" |
| +#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" |
| #include "mojo/services/public/cpp/view_manager/view_observer.h" |
| +#include "mojo/services/public/interfaces/content_handler/content_handler.mojom.h" |
| #include "mojo/services/public/interfaces/navigation/navigation.mojom.h" |
| #include "mojo/services/public/interfaces/network/url_loader.mojom.h" |
| #include "third_party/WebKit/public/web/WebFrameClient.h" |
| @@ -22,16 +25,30 @@ class View; |
| // A view for a single HTML document. |
| class HTMLDocumentView : public blink::WebViewClient, |
| public blink::WebFrameClient, |
| + public ViewManagerDelegate, |
| public ViewObserver { |
| public: |
| - HTMLDocumentView(ServiceProvider* service_provider, |
| - ViewManager* view_manager); |
| + // Load a new HTMLDocument with |response|. |
| + // |
| + // |imported_from_connector| is used to request services of the connecting |
| + // application (e.g., the application that called |
|
darin (slow to review)
2014/08/29 05:59:42
do you mean the application that called ConnectToA
|
| + // ContentHandler::OnConnect()). |
| + // |
| + // |exported_to_connector| is used to export services from this |
| + // HTMLDocumentView to the connecting application. |
| + // |
| + // |shell_connection| is the original ServiceProvider that was passed to |
|
darin (slow to review)
2014/08/29 05:59:42
nit: ServiceProvider -> ApplicationConnection
|
| + // HTMLViewer. |
| + // |
| + // TODO(aa): Remove |shell_connection|. It is used to get the NavigatorHost |
| + // from the window manager. That should be exposed via the |
| + // |exported_from_embedder| param to OnEmbed() instead. |
| + HTMLDocumentView(URLResponsePtr response, |
| + scoped_ptr<ServiceProvider> imported_from_connector, |
|
darin (slow to review)
2014/08/29 05:59:42
in the .cc file you use the variable names importe
|
| + ServiceProviderImpl* exported_to_connector, |
| + ApplicationConnection* shell_connection); |
| virtual ~HTMLDocumentView(); |
| - void AttachToView(View* view); |
| - |
| - void Load(URLResponsePtr response); |
| - |
| private: |
| // WebViewClient methods: |
| virtual blink::WebStorageNamespace* createSessionStorageNamespace(); |
| @@ -59,6 +76,14 @@ class HTMLDocumentView : public blink::WebViewClient, |
| const blink::WebHistoryItem& history_item, |
| blink::WebHistoryCommitType commit_type); |
| + // ViewManagerDelegate methods: |
| + virtual void OnEmbed( |
| + ViewManager* view_manager, |
| + View* root, |
| + ServiceProviderImpl* exported_to_embedder, |
| + scoped_ptr<ServiceProvider> exported_from_embedder) OVERRIDE; |
| + virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE; |
| + |
| // ViewObserver methods: |
| virtual void OnViewBoundsChanged(View* view, |
| const gfx::Rect& old_bounds, |
| @@ -66,12 +91,16 @@ class HTMLDocumentView : public blink::WebViewClient, |
| virtual void OnViewDestroyed(View* view) OVERRIDE; |
| virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE; |
| + void Load(URLResponsePtr response); |
| + |
| void Repaint(); |
| - ViewManager* view_manager_; |
| + URLResponsePtr response_; |
| + scoped_ptr<ServiceProvider> imported_services_; |
| LazyInterfacePtr<NavigatorHost> navigator_host_; |
| blink::WebView* web_view_; |
| View* root_; |
| + ViewManagerClientFactory view_manager_client_factory_; |
| bool repaint_pending_; |
| base::WeakPtrFactory<HTMLDocumentView> weak_factory_; |