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

Side by Side Diff: mojo/examples/nesting_app/nesting_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/media_viewer/media_viewer.cc ('k') | mojo/examples/png_viewer/png_viewer.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/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "mojo/examples/window_manager/window_manager.mojom.h" 9 #include "mojo/examples/window_manager/window_manager.mojom.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 connection->AddService(&navigator_factory_); 80 connection->AddService(&navigator_factory_);
81 // TODO(davemoore): Is this ok? 81 // TODO(davemoore): Is this ok?
82 if (!navigator_) { 82 if (!navigator_) {
83 connection->ConnectToApplication( 83 connection->ConnectToApplication(
84 kEmbeddedAppURL)->ConnectToService(&navigator_); 84 kEmbeddedAppURL)->ConnectToService(&navigator_);
85 } 85 }
86 return true; 86 return true;
87 } 87 }
88 88
89 // Overridden from ViewManagerDelegate: 89 // Overridden from ViewManagerDelegate:
90 virtual void OnEmbed(ViewManager* view_manager, Node* root) OVERRIDE { 90 virtual void OnEmbed(ViewManager* view_manager,
91 Node* root,
92 ServiceProviderImpl* exported_services,
93 scoped_ptr<ServiceProvider> imported_services) OVERRIDE {
91 root->AddObserver(this); 94 root->AddObserver(this);
92 95
93 View* view = View::Create(view_manager); 96 View* view = View::Create(view_manager);
94 root->SetActiveView(view); 97 root->SetActiveView(view);
95 view->SetColor(SK_ColorCYAN); 98 view->SetColor(SK_ColorCYAN);
96 view->AddObserver(this); 99 view->AddObserver(this);
97 100
98 nested_ = Node::Create(view_manager); 101 nested_ = Node::Create(view_manager);
99 root->AddChild(nested_); 102 root->AddChild(nested_);
100 nested_->SetBounds(gfx::Rect(20, 20, 50, 50)); 103 nested_->SetBounds(gfx::Rect(20, 20, 50, 50));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 145 }
143 146
144 } // namespace examples 147 } // namespace examples
145 148
146 // static 149 // static
147 ApplicationDelegate* ApplicationDelegate::Create() { 150 ApplicationDelegate* ApplicationDelegate::Create() {
148 return new examples::NestingApp; 151 return new examples::NestingApp;
149 } 152 }
150 153
151 } // namespace mojo 154 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/media_viewer/media_viewer.cc ('k') | mojo/examples/png_viewer/png_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698