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

Side by Side Diff: services/window_manager/main.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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "mojo/application/application_runner_chromium.h" 6 #include "mojo/application/application_runner_chromium.h"
7 #include "mojo/common/tracing_impl.h" 7 #include "mojo/common/tracing_impl.h"
8 #include "mojo/public/c/system/main.h" 8 #include "mojo/public/c/system/main.h"
9 #include "mojo/public/cpp/application/application_delegate.h" 9 #include "mojo/public/cpp/application/application_delegate.h"
10 #include "mojo/public/cpp/application/service_provider_impl.h" 10 #include "mojo/public/cpp/application/service_provider_impl.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 ~DefaultWindowManager() override {} 35 ~DefaultWindowManager() override {}
36 36
37 private: 37 private:
38 // Overridden from mojo::ApplicationDelegate: 38 // Overridden from mojo::ApplicationDelegate:
39 void Initialize(mojo::ApplicationImpl* impl) override { 39 void Initialize(mojo::ApplicationImpl* impl) override {
40 window_manager_app_->Initialize(impl); 40 window_manager_app_->Initialize(impl);
41 tracing_.Initialize(impl); 41 tracing_.Initialize(impl);
42 } 42 }
43 bool ConfigureIncomingConnection( 43 bool ConfigureIncomingConnection(
44 mojo::ApplicationConnection* connection) override { 44 mojo::ApplicationConnection* connection,
45 window_manager_app_->ConfigureIncomingConnection(connection); 45 const std::string& url) override {
46 window_manager_app_->ConfigureIncomingConnection(connection, url);
46 return true; 47 return true;
47 } 48 }
48 49
49 // Overridden from ViewManagerDelegate: 50 // Overridden from ViewManagerDelegate:
50 void OnEmbed(View* root, 51 void OnEmbed(View* root,
51 mojo::InterfaceRequest<mojo::ServiceProvider> services, 52 mojo::InterfaceRequest<mojo::ServiceProvider> services,
52 mojo::ServiceProviderPtr exposed_services) override { 53 mojo::ServiceProviderPtr exposed_services) override {
53 root_ = root; 54 root_ = root;
54 window_manager_app_->InitFocus( 55 window_manager_app_->InitFocus(
55 make_scoped_ptr(new window_manager::BasicFocusRules(root_))); 56 make_scoped_ptr(new window_manager::BasicFocusRules(root_)));
(...skipping 27 matching lines...) Expand all
83 MOJO_DISALLOW_COPY_AND_ASSIGN(DefaultWindowManager); 84 MOJO_DISALLOW_COPY_AND_ASSIGN(DefaultWindowManager);
84 }; 85 };
85 86
86 } // namespace window_manager 87 } // namespace window_manager
87 88
88 MojoResult MojoMain(MojoHandle shell_handle) { 89 MojoResult MojoMain(MojoHandle shell_handle) {
89 mojo::ApplicationRunnerChromium runner( 90 mojo::ApplicationRunnerChromium runner(
90 new window_manager::DefaultWindowManager); 91 new window_manager::DefaultWindowManager);
91 return runner.Run(shell_handle); 92 return runner.Run(shell_handle);
92 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698