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

Unified Diff: mojo/services/html_viewer/html_document_view.cc

Issue 695953002: Update html_viewer to follow to content handle API change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: mojo/services/html_viewer/html_document_view.cc
diff --git a/mojo/services/html_viewer/html_document_view.cc b/mojo/services/html_viewer/html_document_view.cc
index 9b24350c00e5e374782401628c1198927835be54..b83e0e4367d61f01058bcba5f9bd95c1eff26258 100644
--- a/mojo/services/html_viewer/html_document_view.cc
+++ b/mojo/services/html_viewer/html_document_view.cc
@@ -11,7 +11,6 @@
#include "base/strings/string_util.h"
#include "base/thread_task_runner_handle.h"
#include "mojo/public/cpp/application/connect.h"
-#include "mojo/public/cpp/application/service_provider_impl.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/html_viewer/blink_input_events_type_converters.h"
@@ -87,21 +86,18 @@ bool CanNavigateLocally(blink::WebFrame* frame,
HTMLDocumentView::HTMLDocumentView(
URLResponsePtr response,
- InterfaceRequest<ServiceProvider> service_provider_request,
- Shell* shell,
+ mojo::ShellPtr shell,
jamesr 2014/10/31 18:10:19 this code is in namespace mojo already, no need fo
scoped_refptr<base::MessageLoopProxy> compositor_thread,
WebMediaPlayerFactory* web_media_player_factory)
- : shell_(shell),
+ : response_(response.Pass()),
+ shell_(shell.Pass()),
web_view_(NULL),
root_(NULL),
- view_manager_client_factory_(shell, this),
+ view_manager_client_factory_(shell_.get(), this),
compositor_thread_(compositor_thread),
web_media_player_factory_(web_media_player_factory),
weak_factory_(this) {
- ServiceProviderImpl* exported_services = new ServiceProviderImpl();
- exported_services->AddService(&view_manager_client_factory_);
- BindToRequest(exported_services, &service_provider_request);
- Load(response.Pass());
+ shell_.set_client(this);
}
HTMLDocumentView::~HTMLDocumentView() {
@@ -111,6 +107,16 @@ HTMLDocumentView::~HTMLDocumentView() {
root_->RemoveObserver(this);
}
+void HTMLDocumentView::AcceptConnection(const String& requestor_url,
+ ServiceProviderPtr provider) {
+ exported_services_.AddService(&view_manager_client_factory_);
+ mojo::WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
+ Load(response_.Pass());
+}
+
+void HTMLDocumentView::Initialize(mojo::Array<mojo::String> args) {
+}
+
void HTMLDocumentView::OnEmbed(
ViewManager* view_manager,
View* root,
@@ -180,7 +186,7 @@ blink::WebMediaPlayer* HTMLDocumentView::createMediaPlayer(
const blink::WebURL& url,
blink::WebMediaPlayerClient* client) {
return web_media_player_factory_->CreateMediaPlayer(
- frame, url, client, shell_);
+ frame, url, client, shell_.get());
}
blink::WebMediaPlayer* HTMLDocumentView::createMediaPlayer(

Powered by Google App Engine
This is Rietveld 408576698