Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: chrome/app_installer/win/app_installer_util.cc

Issue 685103004: Refactor chrome_launcher_support::GetAnyChromePath. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix app_installer compile. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/app_installer/win/app_installer_util.h ('k') | chrome/app_shim/win/app_shim_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/app_installer/win/app_installer_util.h ('k') | chrome/app_shim/win/app_shim_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698