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/app_installer/win/app_installer_util.h" | 5 #include "chrome/app_installer/win/app_installer_util.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <urlmon.h> | 8 #include <urlmon.h> |
9 #include <winhttp.h> | 9 #include <winhttp.h> |
10 #pragma comment(lib, "urlmon.lib") | 10 #pragma comment(lib, "urlmon.lib") |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 291 |
292 if (!WinHttpReceiveResponse(request_handle.Get(), NULL)) { | 292 if (!WinHttpReceiveResponse(request_handle.Get(), NULL)) { |
293 PLOG(ERROR); | 293 PLOG(ERROR); |
294 return false; | 294 return false; |
295 } | 295 } |
296 | 296 |
297 response_data->clear(); | 297 response_data->clear(); |
298 return ReadHttpData(request_handle.Get(), response_data); | 298 return ReadHttpData(request_handle.Get(), response_data); |
299 } | 299 } |
300 | 300 |
301 base::FilePath GetChromeExePath(bool is_canary) { | |
302 return is_canary ? chrome_launcher_support::GetAnyChromeSxSPath() | |
303 : chrome_launcher_support::GetAnyChromePath(); | |
304 } | |
305 | |
306 ExitCode GetChrome(bool is_canary, const std::string& inline_install_json) { | 301 ExitCode GetChrome(bool is_canary, const std::string& inline_install_json) { |
307 // Show UI to install Chrome. The UI returns a download URL. | 302 // Show UI to install Chrome. The UI returns a download URL. |
308 base::string16 download_url = | 303 base::string16 download_url = |
309 DownloadAndEulaHTMLDialog(is_canary, inline_install_json).ShowModal(); | 304 DownloadAndEulaHTMLDialog(is_canary, inline_install_json).ShowModal(); |
310 if (download_url.empty()) | 305 if (download_url.empty()) |
311 return EULA_CANCELLED; | 306 return EULA_CANCELLED; |
312 | 307 |
313 DVLOG(1) << "Chrome download url: " << download_url; | 308 DVLOG(1) << "Chrome download url: " << download_url; |
314 | 309 |
315 // Get a temporary file path. | 310 // Get a temporary file path. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 367 |
373 // Install Chrome. Wait for the installer to finish before returning. | 368 // Install Chrome. Wait for the installer to finish before returning. |
374 base::LaunchOptions options; | 369 base::LaunchOptions options; |
375 options.wait = true; | 370 options.wait = true; |
376 bool launch_success = base::LaunchProcess(command_line, options).IsValid(); | 371 bool launch_success = base::LaunchProcess(command_line, options).IsValid(); |
377 base::DeleteFile(setup_file, false); | 372 base::DeleteFile(setup_file, false); |
378 return launch_success ? SUCCESS : FAILED_TO_LAUNCH_CHROME_SETUP; | 373 return launch_success ? SUCCESS : FAILED_TO_LAUNCH_CHROME_SETUP; |
379 } | 374 } |
380 | 375 |
381 } // namespace app_installer | 376 } // namespace app_installer |
OLD | NEW |