| OLD | NEW |
| 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 "shell/url_resolver.h" | 5 #include "shell/url_resolver.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "shell/application_manager/query_util.h" | 10 #include "shell/application_manager/query_util.h" |
| 11 #include "shell/filename_util.h" | 11 #include "shell/filename_util.h" |
| 12 #include "shell/switches.h" | 12 #include "shell/switches.h" |
| 13 #include "url/url_util.h" | 13 #include "url/url_util.h" |
| 14 | 14 |
| 15 namespace mojo { | |
| 16 namespace shell { | 15 namespace shell { |
| 17 | 16 |
| 18 URLResolver::URLResolver() { | 17 URLResolver::URLResolver() { |
| 19 // Needed to treat first component of mojo URLs as host, not path. | 18 // Needed to treat first component of mojo URLs as host, not path. |
| 20 url::AddStandardScheme("mojo"); | 19 url::AddStandardScheme("mojo"); |
| 21 } | 20 } |
| 22 | 21 |
| 23 URLResolver::~URLResolver() { | 22 URLResolver::~URLResolver() { |
| 24 } | 23 } |
| 25 | 24 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } else { | 100 } else { |
| 102 // It's still a mojo: URL, use the default mapping scheme. | 101 // It's still a mojo: URL, use the default mapping scheme. |
| 103 std::string query; | 102 std::string query; |
| 104 GURL base_url = GetBaseURLAndQuery(mojo_url, &query); | 103 GURL base_url = GetBaseURLAndQuery(mojo_url, &query); |
| 105 std::string lib = base_url.host() + ".mojo" + query; | 104 std::string lib = base_url.host() + ".mojo" + query; |
| 106 return mojo_base_url_.Resolve(lib); | 105 return mojo_base_url_.Resolve(lib); |
| 107 } | 106 } |
| 108 } | 107 } |
| 109 | 108 |
| 110 } // namespace shell | 109 } // namespace shell |
| 111 } // namespace mojo | |
| OLD | NEW |