Chromium Code Reviews| 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( |