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 "chrome/browser/chromeos/app_mode/fake_cws.h" | 5 #include "chrome/browser/chromeos/app_mode/fake_cws.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 void FakeCWS::SetupWebStoreURL(const GURL& test_server_url) { | 106 void FakeCWS::SetupWebStoreURL(const GURL& test_server_url) { |
107 std::string webstore_host(kWebstoreDomain); | 107 std::string webstore_host(kWebstoreDomain); |
108 GURL::Replacements replace_webstore_host; | 108 GURL::Replacements replace_webstore_host; |
109 replace_webstore_host.SetHostStr(webstore_host); | 109 replace_webstore_host.SetHostStr(webstore_host); |
110 web_store_url_ = test_server_url.ReplaceComponents(replace_webstore_host); | 110 web_store_url_ = test_server_url.ReplaceComponents(replace_webstore_host); |
111 } | 111 } |
112 | 112 |
113 void FakeCWS::OverrideGalleryCommandlineSwitches() { | 113 void FakeCWS::OverrideGalleryCommandlineSwitches() { |
114 DCHECK(web_store_url_.is_valid()); | 114 DCHECK(web_store_url_.is_valid()); |
115 | 115 |
116 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 116 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
117 | 117 |
118 command_line->AppendSwitchASCII( | 118 command_line->AppendSwitchASCII( |
119 ::switches::kAppsGalleryURL, | 119 ::switches::kAppsGalleryURL, |
120 web_store_url_.Resolve("/chromeos/app_mode/webstore").spec()); | 120 web_store_url_.Resolve("/chromeos/app_mode/webstore").spec()); |
121 | 121 |
122 std::string downloads_path = std::string(kCrxDownloadPath).append("%s.crx"); | 122 std::string downloads_path = std::string(kCrxDownloadPath).append("%s.crx"); |
123 GURL downloads_url = web_store_url_.Resolve(downloads_path); | 123 GURL downloads_url = web_store_url_.Resolve(downloads_path); |
124 command_line->AppendSwitchASCII(::switches::kAppsGalleryDownloadURL, | 124 command_line->AppendSwitchASCII(::switches::kAppsGalleryDownloadURL, |
125 downloads_url.spec()); | 125 downloads_url.spec()); |
126 | 126 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 http_response->set_code(net::HTTP_OK); | 160 http_response->set_code(net::HTTP_OK); |
161 http_response->set_content_type("text/xml"); | 161 http_response->set_content_type("text/xml"); |
162 http_response->set_content(update_check_content_); | 162 http_response->set_content(update_check_content_); |
163 return http_response.Pass(); | 163 return http_response.Pass(); |
164 } | 164 } |
165 | 165 |
166 return scoped_ptr<HttpResponse>(); | 166 return scoped_ptr<HttpResponse>(); |
167 } | 167 } |
168 | 168 |
169 } // namespace chromeos | 169 } // namespace chromeos |
OLD | NEW |