| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <atlbase.h> | 5 #include <atlbase.h> |
| 6 #include <atlcom.h> | 6 #include <atlcom.h> |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 | 9 |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 #include "google_update_idl.h" | 43 #include "google_update_idl.h" |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 | 46 |
| 47 // The kSentinelFile file absence will tell us it is a first run. | 47 // The kSentinelFile file absence will tell us it is a first run. |
| 48 const wchar_t kSentinelFile[] = L"First Run"; | 48 const wchar_t kSentinelFile[] = L"First Run"; |
| 49 | 49 |
| 50 // Gives the full path to the sentinel file. The file might not exist. | 50 // Gives the full path to the sentinel file. The file might not exist. |
| 51 bool GetFirstRunSentinelFilePath(std::wstring* path) { | 51 bool GetFirstRunSentinelFilePath(std::wstring* path) { |
| 52 std::wstring exe_path; |
| 53 if (!PathService::Get(base::DIR_EXE, &exe_path)) |
| 54 return false; |
| 55 |
| 52 std::wstring first_run_sentinel; | 56 std::wstring first_run_sentinel; |
| 53 if (!PathService::Get(base::DIR_EXE, &first_run_sentinel)) | 57 if (InstallUtil::IsPerUserInstall(exe_path.c_str())) { |
| 54 return false; | 58 first_run_sentinel = exe_path; |
| 59 } else { |
| 60 if (!PathService::Get(chrome::DIR_USER_DATA, &first_run_sentinel)) |
| 61 return false; |
| 62 } |
| 63 |
| 55 file_util::AppendToPath(&first_run_sentinel, kSentinelFile); | 64 file_util::AppendToPath(&first_run_sentinel, kSentinelFile); |
| 56 *path = first_run_sentinel; | 65 *path = first_run_sentinel; |
| 57 return true; | 66 return true; |
| 58 } | 67 } |
| 59 | 68 |
| 60 bool GetNewerChromeFile(std::wstring* path) { | 69 bool GetNewerChromeFile(std::wstring* path) { |
| 61 if (!PathService::Get(base::DIR_EXE, path)) | 70 if (!PathService::Get(base::DIR_EXE, path)) |
| 62 return false; | 71 return false; |
| 63 file_util::AppendToPath(path, installer_util::kChromeNewExe); | 72 file_util::AppendToPath(path, installer_util::kChromeNewExe); |
| 64 return true; | 73 return true; |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 bool FirstRun::SetShowWelcomePagePref() { | 534 bool FirstRun::SetShowWelcomePagePref() { |
| 526 PrefService* local_state = g_browser_process->local_state(); | 535 PrefService* local_state = g_browser_process->local_state(); |
| 527 if (!local_state) | 536 if (!local_state) |
| 528 return false; | 537 return false; |
| 529 if (!local_state->IsPrefRegistered(prefs::kShouldShowWelcomePage)) { | 538 if (!local_state->IsPrefRegistered(prefs::kShouldShowWelcomePage)) { |
| 530 local_state->RegisterBooleanPref(prefs::kShouldShowWelcomePage, false); | 539 local_state->RegisterBooleanPref(prefs::kShouldShowWelcomePage, false); |
| 531 local_state->SetBoolean(prefs::kShouldShowWelcomePage, true); | 540 local_state->SetBoolean(prefs::kShouldShowWelcomePage, true); |
| 532 } | 541 } |
| 533 return true; | 542 return true; |
| 534 } | 543 } |
| OLD | NEW |