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

Side by Side Diff: examples/embedded_app/embedded_app.cc

Issue 815003002: Nukes ViewManager arg from ViewManagerDelegate::OnEmbed (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: format Created 6 years 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
« no previous file with comments | « examples/browser/browser.cc ('k') | examples/ganesh_app/ganesh_app.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/bind.h" 5 #include "base/bind.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/macros.h" 7 #include "base/macros.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 "examples/bitmap_uploader/bitmap_uploader.h" 10 #include "examples/bitmap_uploader/bitmap_uploader.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 new ViewManagerClientFactory(app->shell(), this)); 64 new ViewManagerClientFactory(app->shell(), this));
65 } 65 }
66 66
67 virtual bool ConfigureIncomingConnection( 67 virtual bool ConfigureIncomingConnection(
68 ApplicationConnection* connection) override { 68 ApplicationConnection* connection) override {
69 connection->AddService(view_manager_client_factory_.get()); 69 connection->AddService(view_manager_client_factory_.get());
70 return true; 70 return true;
71 } 71 }
72 72
73 // Overridden from ViewManagerDelegate: 73 // Overridden from ViewManagerDelegate:
74 virtual void OnEmbed(ViewManager* view_manager, 74 virtual void OnEmbed(View* root,
75 View* root,
76 ServiceProviderImpl* exported_services, 75 ServiceProviderImpl* exported_services,
77 scoped_ptr<ServiceProvider> imported_services) override { 76 scoped_ptr<ServiceProvider> imported_services) override {
78 root->AddObserver(this); 77 root->AddObserver(this);
79 Window* window = new Window(root, imported_services.Pass(), shell_); 78 Window* window = new Window(root, imported_services.Pass(), shell_);
80 windows_[root->id()] = window; 79 windows_[root->id()] = window;
81 window->bitmap_uploader.SetColor( 80 window->bitmap_uploader.SetColor(
82 kColors[next_color_++ % arraysize(kColors)]); 81 kColors[next_color_++ % arraysize(kColors)]);
83 } 82 }
84 virtual void OnViewManagerDisconnected(ViewManager* view_manager) override { 83 virtual void OnViewManagerDisconnected(ViewManager* view_manager) override {
85 base::MessageLoop::current()->Quit(); 84 base::MessageLoop::current()->Quit();
(...skipping 28 matching lines...) Expand all
114 DISALLOW_COPY_AND_ASSIGN(EmbeddedApp); 113 DISALLOW_COPY_AND_ASSIGN(EmbeddedApp);
115 }; 114 };
116 115
117 } // namespace examples 116 } // namespace examples
118 } // namespace mojo 117 } // namespace mojo
119 118
120 MojoResult MojoMain(MojoHandle shell_handle) { 119 MojoResult MojoMain(MojoHandle shell_handle) {
121 mojo::ApplicationRunnerChromium runner(new mojo::examples::EmbeddedApp); 120 mojo::ApplicationRunnerChromium runner(new mojo::examples::EmbeddedApp);
122 return runner.Run(shell_handle); 121 return runner.Run(shell_handle);
123 } 122 }
OLDNEW
« no previous file with comments | « examples/browser/browser.cc ('k') | examples/ganesh_app/ganesh_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698