| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 &update_check_content_); | 97 &update_check_content_); |
| 98 } | 98 } |
| 99 | 99 |
| 100 int FakeCWS::GetUpdateCheckCountAndReset() { | 100 int FakeCWS::GetUpdateCheckCountAndReset() { |
| 101 int current_count = update_check_count_; | 101 int current_count = update_check_count_; |
| 102 update_check_count_ = 0; | 102 update_check_count_ = 0; |
| 103 return current_count; | 103 return current_count; |
| 104 } | 104 } |
| 105 | 105 |
| 106 void FakeCWS::SetupWebStoreURL(const GURL& test_server_url) { | 106 void FakeCWS::SetupWebStoreURL(const GURL& test_server_url) { |
| 107 std::string webstore_host(kWebstoreDomain); | |
| 108 GURL::Replacements replace_webstore_host; | 107 GURL::Replacements replace_webstore_host; |
| 109 replace_webstore_host.SetHostStr(webstore_host); | 108 replace_webstore_host.SetHostStr(kWebstoreDomain); |
| 110 web_store_url_ = test_server_url.ReplaceComponents(replace_webstore_host); | 109 web_store_url_ = test_server_url.ReplaceComponents(replace_webstore_host); |
| 111 } | 110 } |
| 112 | 111 |
| 113 void FakeCWS::OverrideGalleryCommandlineSwitches() { | 112 void FakeCWS::OverrideGalleryCommandlineSwitches() { |
| 114 DCHECK(web_store_url_.is_valid()); | 113 DCHECK(web_store_url_.is_valid()); |
| 115 | 114 |
| 116 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 115 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 117 | 116 |
| 118 command_line->AppendSwitchASCII( | 117 command_line->AppendSwitchASCII( |
| 119 ::switches::kAppsGalleryURL, | 118 ::switches::kAppsGalleryURL, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 http_response->set_code(net::HTTP_OK); | 159 http_response->set_code(net::HTTP_OK); |
| 161 http_response->set_content_type("text/xml"); | 160 http_response->set_content_type("text/xml"); |
| 162 http_response->set_content(update_check_content_); | 161 http_response->set_content(update_check_content_); |
| 163 return http_response.Pass(); | 162 return http_response.Pass(); |
| 164 } | 163 } |
| 165 | 164 |
| 166 return scoped_ptr<HttpResponse>(); | 165 return scoped_ptr<HttpResponse>(); |
| 167 } | 166 } |
| 168 | 167 |
| 169 } // namespace chromeos | 168 } // namespace chromeos |
| OLD | NEW |