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

Side by Side Diff: examples/wm_flow/app/app.cc

Issue 943053003: Simple multi-url support for mojo apps (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: hate Created 5 years, 9 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
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 <map> 5 #include <map>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "examples/bitmap_uploader/bitmap_uploader.h" 10 #include "examples/bitmap_uploader/bitmap_uploader.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 new mojo::ViewManagerClientFactory(app->shell(), this)); 97 new mojo::ViewManagerClientFactory(app->shell(), this));
98 view_manager_context_.reset(new mojo::ViewManagerContext(app)); 98 view_manager_context_.reset(new mojo::ViewManagerContext(app));
99 // FIXME: Mojo applications don't know their URLs yet: 99 // FIXME: Mojo applications don't know their URLs yet:
100 // https://docs.google.com/a/chromium.org/document/d/1AQ2y6ekzvbdaMF5WrUQmne yXJnke-MnYYL4Gz1AKDos 100 // https://docs.google.com/a/chromium.org/document/d/1AQ2y6ekzvbdaMF5WrUQmne yXJnke-MnYYL4Gz1AKDos
101 url_ = GURL(app->args()[1]); 101 url_ = GURL(app->args()[1]);
102 OpenNewWindow(); 102 OpenNewWindow();
103 OpenNewWindow(); 103 OpenNewWindow();
104 OpenNewWindow(); 104 OpenNewWindow();
105 } 105 }
106 virtual bool ConfigureIncomingConnection( 106 virtual bool ConfigureIncomingConnection(
107 mojo::ApplicationConnection* connection) override { 107 mojo::ApplicationConnection* connection,
108 const std::string& url) override {
108 connection->AddService(view_manager_client_factory_.get()); 109 connection->AddService(view_manager_client_factory_.get());
109 return true; 110 return true;
110 } 111 }
111 112
112 // Overridden from mojo::ViewManagerDelegate: 113 // Overridden from mojo::ViewManagerDelegate:
113 virtual void OnEmbed(mojo::View* root, 114 virtual void OnEmbed(mojo::View* root,
114 mojo::InterfaceRequest<mojo::ServiceProvider> services, 115 mojo::InterfaceRequest<mojo::ServiceProvider> services,
115 mojo::ServiceProviderPtr exposed_services) override { 116 mojo::ServiceProviderPtr exposed_services) override {
116 root->AddObserver(this); 117 root->AddObserver(this);
117 mojo::BitmapUploader* uploader = new mojo::BitmapUploader(root); 118 mojo::BitmapUploader* uploader = new mojo::BitmapUploader(root);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 188
188 DISALLOW_COPY_AND_ASSIGN(WMFlowApp); 189 DISALLOW_COPY_AND_ASSIGN(WMFlowApp);
189 }; 190 };
190 191
191 } // namespace examples 192 } // namespace examples
192 193
193 MojoResult MojoMain(MojoHandle shell_handle) { 194 MojoResult MojoMain(MojoHandle shell_handle) {
194 mojo::ApplicationRunnerChromium runner(new examples::WMFlowApp); 195 mojo::ApplicationRunnerChromium runner(new examples::WMFlowApp);
195 return runner.Run(shell_handle); 196 return runner.Run(shell_handle);
196 } 197 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698