| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 base::Bind(&FakeCWS::HandleRequest, base::Unretained(this))); | 86 base::Bind(&FakeCWS::HandleRequest, base::Unretained(this))); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void FakeCWS::InitAsPrivateStore(net::EmbeddedTestServer* embedded_test_server, | 89 void FakeCWS::InitAsPrivateStore(net::EmbeddedTestServer* embedded_test_server, |
| 90 const std::string& update_check_end_point) { | 90 const std::string& update_check_end_point) { |
| 91 has_update_template_ = kPrivateStoreAppHasUpdateTemplate; | 91 has_update_template_ = kPrivateStoreAppHasUpdateTemplate; |
| 92 no_update_template_ = kAppNoUpdateTemplate; | 92 no_update_template_ = kAppNoUpdateTemplate; |
| 93 update_check_end_point_ = update_check_end_point; | 93 update_check_end_point_ = update_check_end_point; |
| 94 | 94 |
| 95 SetupWebStoreURL(embedded_test_server->base_url()); | 95 SetupWebStoreURL(embedded_test_server->base_url()); |
| 96 OverrideGalleryCommandlineSwitches(); |
| 97 |
| 96 embedded_test_server->RegisterRequestHandler( | 98 embedded_test_server->RegisterRequestHandler( |
| 97 base::Bind(&FakeCWS::HandleRequest, base::Unretained(this))); | 99 base::Bind(&FakeCWS::HandleRequest, base::Unretained(this))); |
| 98 } | 100 } |
| 99 | 101 |
| 100 void FakeCWS::SetUpdateCrx(const std::string& app_id, | 102 void FakeCWS::SetUpdateCrx(const std::string& app_id, |
| 101 const std::string& crx_file, | 103 const std::string& crx_file, |
| 102 const std::string& version) { | 104 const std::string& version) { |
| 103 GURL crx_download_url = web_store_url_.Resolve(kCrxDownloadPath + crx_file); | 105 GURL crx_download_url = web_store_url_.Resolve(kCrxDownloadPath + crx_file); |
| 104 | 106 |
| 105 base::FilePath test_data_dir; | 107 base::FilePath test_data_dir; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 http_response->set_content(update_check_content); | 202 http_response->set_content(update_check_content); |
| 201 return http_response.Pass(); | 203 return http_response.Pass(); |
| 202 } | 204 } |
| 203 } | 205 } |
| 204 } | 206 } |
| 205 | 207 |
| 206 return scoped_ptr<HttpResponse>(); | 208 return scoped_ptr<HttpResponse>(); |
| 207 } | 209 } |
| 208 | 210 |
| 209 } // namespace chromeos | 211 } // namespace chromeos |
| OLD | NEW |