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

Side by Side Diff: content/browser/mojo/mojo_shell_context.cc

Issue 1371793004: Provide the DeviceManager service to the renderer directly, no app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface_permission
Patch Set: Fix header inclusion in chrome_content_browser_client.cc. Created 5 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/mojo/mojo_shell_context.h" 5 #include "content/browser/mojo/mojo_shell_context.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // the url scheme registry is locked. 161 // the url scheme registry is locked.
162 scoped_ptr<mojo::package_manager::PackageManagerImpl> package_manager( 162 scoped_ptr<mojo::package_manager::PackageManagerImpl> package_manager(
163 new mojo::package_manager::PackageManagerImpl(base::FilePath(), nullptr)); 163 new mojo::package_manager::PackageManagerImpl(base::FilePath(), nullptr));
164 application_manager_.reset( 164 application_manager_.reset(
165 new mojo::shell::ApplicationManager(package_manager.Pass())); 165 new mojo::shell::ApplicationManager(package_manager.Pass()));
166 166
167 application_manager_->set_default_loader( 167 application_manager_->set_default_loader(
168 scoped_ptr<mojo::shell::ApplicationLoader>(new DefaultApplicationLoader)); 168 scoped_ptr<mojo::shell::ApplicationLoader>(new DefaultApplicationLoader));
169 169
170 StaticApplicationMap apps; 170 StaticApplicationMap apps;
171 GetContentClient()->browser()->RegisterInProcessMojoApplications(&apps);
172 if (g_applications_for_test) { 171 if (g_applications_for_test) {
173 // Add testing apps to the map, potentially overwriting whatever the 172 // Add testing apps to the map, potentially overwriting whatever the
174 // browser client registered. 173 // browser client registered.
175 for (const auto& entry : *g_applications_for_test) 174 for (const auto& entry : *g_applications_for_test)
176 apps[entry.first] = entry.second; 175 apps[entry.first] = entry.second;
177 } 176 }
178 for (const auto& entry : apps) { 177 for (const auto& entry : apps) {
179 application_manager_->SetLoaderForURL( 178 application_manager_->SetLoaderForURL(
180 scoped_ptr<mojo::shell::ApplicationLoader>( 179 scoped_ptr<mojo::shell::ApplicationLoader>(
181 new mojo::shell::StaticApplicationLoader(entry.second)), 180 new mojo::shell::StaticApplicationLoader(entry.second)),
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 mojo::shell::GetPermissiveCapabilityFilter())); 241 mojo::shell::GetPermissiveCapabilityFilter()));
243 params->SetTarget(mojo::shell::Identity(url, std::string(), filter)); 242 params->SetTarget(mojo::shell::Identity(url, std::string(), filter));
244 params->set_services(request.Pass()); 243 params->set_services(request.Pass());
245 params->set_exposed_services(exposed_services.Pass()); 244 params->set_exposed_services(exposed_services.Pass());
246 params->set_on_application_end(base::Bind(&base::DoNothing)); 245 params->set_on_application_end(base::Bind(&base::DoNothing));
247 params->set_connect_callback(callback); 246 params->set_connect_callback(callback);
248 application_manager_->ConnectToApplication(params.Pass()); 247 application_manager_->ConnectToApplication(params.Pass());
249 } 248 }
250 249
251 } // namespace content 250 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698