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..fdd93a2f02f41b5879609a466567dd0833f9d289 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|. |
+ // |
+ // |content_handler_imported| is used to request services of the connecting |
+ // application (e.g., the application that called |
+ // ContentHandler::OnConnect()). |
+ // |
+ // |content_handler_exported| exports services from HTMLDocumentView to the |
+ // connecting application. |
+ // |
+ // |shell_connection| is the original ServiceProvider that was passed to |
+ // HTMLViewer. |
+ // |
+ // TODO(aa): Remove |shell_connection|. It is used to get the NavigatorHost |
+ // from the window manager. That should be exposed via |embedder_exported| |
+ // (see OnEmbed() below) instead. |
+ HTMLDocumentView(ContentHandlerResponsePtr response, |
+ scoped_ptr<ServiceProvider> content_handler_imported, |
+ ServiceProviderImpl* content_handler_exported, |
+ 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_services, |
+ scoped_ptr<ServiceProvider> imported_services) 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_; |
+ ContentHandlerResponsePtr 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_; |