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

Side by Side Diff: mojo/services/html_viewer/html_viewer.cc

Issue 433513005: Pass ServiceProvider thru ViewManagerService::Embed() allowing embedder & embeddee to expose servic… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "mojo/public/cpp/application/application_connection.h" 6 #include "mojo/public/cpp/application/application_connection.h"
7 #include "mojo/public/cpp/application/application_delegate.h" 7 #include "mojo/public/cpp/application/application_delegate.h"
8 #include "mojo/public/cpp/application/application_impl.h" 8 #include "mojo/public/cpp/application/application_impl.h"
9 #include "mojo/public/cpp/application/interface_factory_impl.h" 9 #include "mojo/public/cpp/application/interface_factory_impl.h"
10 #include "mojo/services/html_viewer/blink_platform_impl.h" 10 #include "mojo/services/html_viewer/blink_platform_impl.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) 67 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
68 OVERRIDE { 68 OVERRIDE {
69 connection->AddService(&navigator_factory_); 69 connection->AddService(&navigator_factory_);
70 connection->AddService(&view_manager_client_factory_); 70 connection->AddService(&view_manager_client_factory_);
71 return true; 71 return true;
72 } 72 }
73 73
74 // Overridden from ViewManagerDelegate: 74 // Overridden from ViewManagerDelegate:
75 virtual void OnEmbed(ViewManager* view_manager, Node* root) OVERRIDE { 75 virtual void OnEmbed(ViewManager* view_manager,
76 Node* root,
77 ServiceProviderImpl* exported_services,
78 scoped_ptr<ServiceProvider> imported_services) OVERRIDE {
76 document_view_ = new HTMLDocumentView( 79 document_view_ = new HTMLDocumentView(
77 application_impl_->ConnectToApplication("mojo://mojo_window_manager/")-> 80 application_impl_->ConnectToApplication("mojo://mojo_window_manager/")->
78 GetServiceProvider(), 81 GetServiceProvider(),
79 view_manager); 82 view_manager);
80 document_view_->AttachToNode(root); 83 document_view_->AttachToNode(root);
81 MaybeLoad(); 84 MaybeLoad();
82 } 85 }
83 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { 86 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE {
84 base::MessageLoop::current()->Quit(); 87 base::MessageLoop::current()->Quit();
85 } 88 }
(...skipping 21 matching lines...) Expand all
107 ResponseDetailsPtr response_details) { 110 ResponseDetailsPtr response_details) {
108 viewer_->Load(response_details.Pass()); 111 viewer_->Load(response_details.Pass());
109 } 112 }
110 113
111 // static 114 // static
112 ApplicationDelegate* ApplicationDelegate::Create() { 115 ApplicationDelegate* ApplicationDelegate::Create() {
113 return new HTMLViewer; 116 return new HTMLViewer;
114 } 117 }
115 118
116 } 119 }
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/service_provider_impl.h ('k') | mojo/services/public/cpp/view_manager/lib/node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698