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

Side by Side Diff: mojo/examples/embedded_app/embedded_app.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
« no previous file with comments | « mojo/examples/demo_launcher/demo_launcher.cc ('k') | mojo/examples/keyboard/keyboard.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) 73 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
74 MOJO_OVERRIDE { 74 MOJO_OVERRIDE {
75 connection->AddService(&view_manager_client_factory_); 75 connection->AddService(&view_manager_client_factory_);
76 connection->AddService(&navigator_factory_); 76 connection->AddService(&navigator_factory_);
77 return true; 77 return true;
78 } 78 }
79 79
80 // Overridden from ViewManagerDelegate: 80 // Overridden from ViewManagerDelegate:
81 virtual void OnEmbed(ViewManager* view_manager, Node* root) OVERRIDE { 81 virtual void OnEmbed(ViewManager* view_manager,
82 Node* root,
83 ServiceProviderImpl* exported_services,
84 scoped_ptr<ServiceProvider> imported_services) OVERRIDE {
82 View* view = View::Create(view_manager); 85 View* view = View::Create(view_manager);
83 view->AddObserver(this); 86 view->AddObserver(this);
84 root->SetActiveView(view); 87 root->SetActiveView(view);
85 root->AddObserver(this); 88 root->AddObserver(this);
86 89
87 roots_[root->id()] = root; 90 roots_[root->id()] = root;
88 ProcessPendingNodeColor(root->id()); 91 ProcessPendingNodeColor(root->id());
89 } 92 }
90 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { 93 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE {
91 base::MessageLoop::current()->Quit(); 94 base::MessageLoop::current()->Quit();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 172 }
170 173
171 } // namespace examples 174 } // namespace examples
172 175
173 // static 176 // static
174 ApplicationDelegate* ApplicationDelegate::Create() { 177 ApplicationDelegate* ApplicationDelegate::Create() {
175 return new examples::EmbeddedApp; 178 return new examples::EmbeddedApp;
176 } 179 }
177 180
178 } // namespace mojo 181 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/demo_launcher/demo_launcher.cc ('k') | mojo/examples/keyboard/keyboard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698