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

Side by Side Diff: chrome/installer/util/install_util.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/installer/util/eula_util.cc ('k') | chrome/installer/util/installer_state.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // See the corresponding header file for description of the functions in this 5 // See the corresponding header file for description of the functions in this
6 // file. 6 // file.
7 7
8 #include "chrome/installer/util/install_util.h" 8 #include "chrome/installer/util/install_util.h"
9 9
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 bool InstallUtil::GetSentinelFilePath(const base::FilePath::CharType* file, 379 bool InstallUtil::GetSentinelFilePath(const base::FilePath::CharType* file,
380 BrowserDistribution* dist, 380 BrowserDistribution* dist,
381 base::FilePath* path) { 381 base::FilePath* path) {
382 base::FilePath exe_path; 382 base::FilePath exe_path;
383 if (!PathService::Get(base::DIR_EXE, &exe_path)) 383 if (!PathService::Get(base::DIR_EXE, &exe_path))
384 return false; 384 return false;
385 385
386 if (IsPerUserInstall(exe_path.value().c_str())) { 386 if (IsPerUserInstall(exe_path.value().c_str())) {
387 const base::FilePath maybe_product_dir(exe_path.DirName().DirName()); 387 const base::FilePath maybe_product_dir(exe_path.DirName().DirName());
388 if (file_util::PathExists(exe_path.Append(installer::kChromeExe))) { 388 if (base::PathExists(exe_path.Append(installer::kChromeExe))) {
389 // DIR_EXE is most likely Chrome's directory in which case |exe_path| is 389 // DIR_EXE is most likely Chrome's directory in which case |exe_path| is
390 // the user-level sentinel path. 390 // the user-level sentinel path.
391 *path = exe_path; 391 *path = exe_path;
392 } else if (file_util::PathExists( 392 } else if (base::PathExists(
393 maybe_product_dir.Append(installer::kChromeExe))) { 393 maybe_product_dir.Append(installer::kChromeExe))) {
394 // DIR_EXE can also be the Installer directory if this is called from a 394 // DIR_EXE can also be the Installer directory if this is called from a
395 // setup.exe running from Application\<version>\Installer (see 395 // setup.exe running from Application\<version>\Installer (see
396 // InstallerState::GetInstallerDirectory) in which case Chrome's directory 396 // InstallerState::GetInstallerDirectory) in which case Chrome's directory
397 // is two levels up. 397 // is two levels up.
398 *path = maybe_product_dir; 398 *path = maybe_product_dir;
399 } else { 399 } else {
400 NOTREACHED(); 400 NOTREACHED();
401 return false; 401 return false;
402 } 402 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 // Open the program and see if it references the expected file. 603 // Open the program and see if it references the expected file.
604 base::win::ScopedHandle handle; 604 base::win::ScopedHandle handle;
605 BY_HANDLE_FILE_INFORMATION info = {}; 605 BY_HANDLE_FILE_INFORMATION info = {};
606 606
607 return (OpenForInfo(path, &handle) && 607 return (OpenForInfo(path, &handle) &&
608 GetInfo(handle, &info) && 608 GetInfo(handle, &info) &&
609 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && 609 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber &&
610 info.nFileIndexHigh == file_info_.nFileIndexHigh && 610 info.nFileIndexHigh == file_info_.nFileIndexHigh &&
611 info.nFileIndexLow == file_info_.nFileIndexLow); 611 info.nFileIndexLow == file_info_.nFileIndexLow);
612 } 612 }
OLDNEW
« no previous file with comments | « chrome/installer/util/eula_util.cc ('k') | chrome/installer/util/installer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698