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

Side by Side Diff: mojo/examples/png_viewer/png_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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/string_tokenizer.h" 8 #include "base/strings/string_tokenizer.h"
9 #include "mojo/examples/media_viewer/media_viewer.mojom.h" 9 #include "mojo/examples/media_viewer/media_viewer.mojom.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // Overridden from ApplicationDelegate: 164 // Overridden from ApplicationDelegate:
165 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) 165 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
166 MOJO_OVERRIDE { 166 MOJO_OVERRIDE {
167 connection->AddService(&navigator_factory_); 167 connection->AddService(&navigator_factory_);
168 connection->AddService(&zoomable_media_factory_); 168 connection->AddService(&zoomable_media_factory_);
169 connection->AddService(&view_manager_client_factory_); 169 connection->AddService(&view_manager_client_factory_);
170 return true; 170 return true;
171 } 171 }
172 172
173 // Overridden from ViewManagerDelegate: 173 // Overridden from ViewManagerDelegate:
174 virtual void OnEmbed(ViewManager* view_manager, Node* root) OVERRIDE { 174 virtual void OnEmbed(ViewManager* view_manager,
175 Node* root,
176 ServiceProviderImpl* exported_services,
177 scoped_ptr<ServiceProvider> imported_services) OVERRIDE {
175 root_ = root; 178 root_ = root;
176 root_->AddObserver(this); 179 root_->AddObserver(this);
177 content_view_ = View::Create(view_manager); 180 content_view_ = View::Create(view_manager);
178 root_->SetActiveView(content_view_); 181 root_->SetActiveView(content_view_);
179 content_view_->SetColor(SK_ColorGRAY); 182 content_view_->SetColor(SK_ColorGRAY);
180 if (!bitmap_.isNull()) 183 if (!bitmap_.isNull())
181 DrawBitmap(); 184 DrawBitmap();
182 } 185 }
183 virtual void OnViewManagerDisconnected( 186 virtual void OnViewManagerDisconnected(
184 ViewManager* view_manager) OVERRIDE { 187 ViewManager* view_manager) OVERRIDE {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 } 249 }
247 250
248 } // namespace examples 251 } // namespace examples
249 252
250 // static 253 // static
251 ApplicationDelegate* ApplicationDelegate::Create() { 254 ApplicationDelegate* ApplicationDelegate::Create() {
252 return new examples::PNGViewer; 255 return new examples::PNGViewer;
253 } 256 }
254 257
255 } // namespace mojo 258 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/nesting_app/nesting_app.cc ('k') | mojo/examples/window_manager/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698