OLD | NEW |
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 installer::kInstallerSuccessLaunchCmdLine, | 262 installer::kInstallerSuccessLaunchCmdLine, |
263 *launch_cmd, | 263 *launch_cmd, |
264 true); | 264 true); |
265 } | 265 } |
266 } | 266 } |
267 | 267 |
268 bool InstallUtil::IsPerUserInstall() { | 268 bool InstallUtil::IsPerUserInstall() { |
269 return !install_static::InstallDetails::Get().system_level(); | 269 return !install_static::InstallDetails::Get().system_level(); |
270 } | 270 } |
271 | 271 |
272 bool InstallUtil::IsChromeSxSProcess() { | |
273 #if defined(GOOGLE_CHROME_BUILD) | |
274 return install_static::InstallDetails::Get().install_mode_index() == | |
275 install_static::CANARY_INDEX; | |
276 #else | |
277 return false; | |
278 #endif | |
279 } | |
280 | |
281 // static | 272 // static |
282 bool InstallUtil::IsFirstRunSentinelPresent() { | 273 bool InstallUtil::IsFirstRunSentinelPresent() { |
283 // TODO(msw): Consolidate with first_run::internal::IsFirstRunSentinelPresent. | 274 // TODO(msw): Consolidate with first_run::internal::IsFirstRunSentinelPresent. |
284 base::FilePath user_data_dir; | 275 base::FilePath user_data_dir; |
285 return !PathService::Get(chrome::DIR_USER_DATA, &user_data_dir) || | 276 return !PathService::Get(chrome::DIR_USER_DATA, &user_data_dir) || |
286 base::PathExists(user_data_dir.Append(chrome::kFirstRunSentinel)); | 277 base::PathExists(user_data_dir.Append(chrome::kFirstRunSentinel)); |
287 } | 278 } |
288 | 279 |
289 // static | 280 // static |
290 bool InstallUtil::GetEULASentinelFilePath(base::FilePath* path) { | 281 bool InstallUtil::GetEULASentinelFilePath(base::FilePath* path) { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 // Open the program and see if it references the expected file. | 539 // Open the program and see if it references the expected file. |
549 base::File file; | 540 base::File file; |
550 BY_HANDLE_FILE_INFORMATION info = {}; | 541 BY_HANDLE_FILE_INFORMATION info = {}; |
551 | 542 |
552 return (OpenForInfo(path, &file) && | 543 return (OpenForInfo(path, &file) && |
553 GetInfo(file, &info) && | 544 GetInfo(file, &info) && |
554 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && | 545 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && |
555 info.nFileIndexHigh == file_info_.nFileIndexHigh && | 546 info.nFileIndexHigh == file_info_.nFileIndexHigh && |
556 info.nFileIndexLow == file_info_.nFileIndexLow); | 547 info.nFileIndexLow == file_info_.nFileIndexLow); |
557 } | 548 } |
OLD | NEW |