OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "shell/context.h" | 5 #include "shell/context.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 resolver->SetMojoBaseURL(base_url); | 119 resolver->SetMojoBaseURL(base_url); |
120 | 120 |
121 // The network service must be loaded from the filesystem. | 121 // The network service must be loaded from the filesystem. |
122 // This mapping is done before the command line URL mapping are processed, so | 122 // This mapping is done before the command line URL mapping are processed, so |
123 // that it can be overridden. | 123 // that it can be overridden. |
124 resolver->AddURLMapping( | 124 resolver->AddURLMapping( |
125 GURL("mojo:network_service"), | 125 GURL("mojo:network_service"), |
126 context->ResolveShellFileURL("file:network_service.mojo")); | 126 context->ResolveShellFileURL("file:network_service.mojo")); |
127 | 127 |
| 128 // Temporary mapping to avoid workflow breakages after app rename. |
| 129 resolver->AddURLMapping(GURL("mojo:sample_app"), GURL("mojo:spinning_cube")); |
| 130 |
128 // Command line URL mapping. | 131 // Command line URL mapping. |
129 std::vector<URLResolver::OriginMapping> origin_mappings = | 132 std::vector<URLResolver::OriginMapping> origin_mappings = |
130 URLResolver::GetOriginMappings(command_line->argv()); | 133 URLResolver::GetOriginMappings(command_line->argv()); |
131 for (const auto& origin_mapping : origin_mappings) | 134 for (const auto& origin_mapping : origin_mappings) |
132 resolver->AddOriginMapping(GURL(origin_mapping.origin), | 135 resolver->AddOriginMapping(GURL(origin_mapping.origin), |
133 GURL(origin_mapping.base_url)); | 136 GURL(origin_mapping.base_url)); |
134 | 137 |
135 if (command_line->HasSwitch(switches::kURLMappings)) { | 138 if (command_line->HasSwitch(switches::kURLMappings)) { |
136 const std::string mappings = | 139 const std::string mappings = |
137 command_line->GetSwitchValueASCII(switches::kURLMappings); | 140 command_line->GetSwitchValueASCII(switches::kURLMappings); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 ScopedMessagePipeHandle Context::ConnectToServiceByName( | 324 ScopedMessagePipeHandle Context::ConnectToServiceByName( |
322 const GURL& application_url, | 325 const GURL& application_url, |
323 const std::string& service_name) { | 326 const std::string& service_name) { |
324 app_urls_.insert(application_url); | 327 app_urls_.insert(application_url); |
325 return application_manager_.ConnectToServiceByName(application_url, | 328 return application_manager_.ConnectToServiceByName(application_url, |
326 service_name).Pass(); | 329 service_name).Pass(); |
327 } | 330 } |
328 | 331 |
329 } // namespace shell | 332 } // namespace shell |
330 } // namespace mojo | 333 } // namespace mojo |
OLD | NEW |