| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
| 6 | 6 |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include <set> | 11 #include <set> |
| 12 #include <sstream> | 12 #include <sstream> |
| 13 | 13 |
| 14 #include "base/environment.h" | 14 #include "base/environment.h" |
| 15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/scoped_comptr_win.h" | |
| 19 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
| 20 #include "base/string_split.h" | 19 #include "base/string_split.h" |
| 21 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 22 #include "base/win/object_watcher.h" | 21 #include "base/win/object_watcher.h" |
| 23 #include "base/win/registry.h" | 22 #include "base/win/registry.h" |
| 23 #include "base/win/scoped_comptr.h" |
| 24 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
| 25 #include "chrome/browser/extensions/extension_service.h" | 25 #include "chrome/browser/extensions/extension_service.h" |
| 26 #include "chrome/browser/extensions/extension_updater.h" | 26 #include "chrome/browser/extensions/extension_updater.h" |
| 27 #include "chrome/browser/importer/importer_host.h" | 27 #include "chrome/browser/importer/importer_host.h" |
| 28 #include "chrome/browser/importer/importer_list.h" | 28 #include "chrome/browser/importer/importer_list.h" |
| 29 #include "chrome/browser/importer/importer_progress_dialog.h" | 29 #include "chrome/browser/importer/importer_progress_dialog.h" |
| 30 #include "chrome/browser/metrics/user_metrics.h" | 30 #include "chrome/browser/metrics/user_metrics.h" |
| 31 #include "chrome/browser/process_singleton.h" | 31 #include "chrome/browser/process_singleton.h" |
| 32 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
| 33 #include "chrome/browser/search_engines/template_url_model.h" | 33 #include "chrome/browser/search_engines/template_url_model.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 64 namespace { | 64 namespace { |
| 65 | 65 |
| 66 bool GetNewerChromeFile(FilePath* path) { | 66 bool GetNewerChromeFile(FilePath* path) { |
| 67 if (!PathService::Get(base::DIR_EXE, path)) | 67 if (!PathService::Get(base::DIR_EXE, path)) |
| 68 return false; | 68 return false; |
| 69 *path = path->Append(installer::kChromeNewExe); | 69 *path = path->Append(installer::kChromeNewExe); |
| 70 return true; | 70 return true; |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool InvokeGoogleUpdateForRename() { | 73 bool InvokeGoogleUpdateForRename() { |
| 74 ScopedComPtr<IProcessLauncher> ipl; | 74 base::win::ScopedComPtr<IProcessLauncher> ipl; |
| 75 if (!FAILED(ipl.CreateInstance(__uuidof(ProcessLauncherClass)))) { | 75 if (!FAILED(ipl.CreateInstance(__uuidof(ProcessLauncherClass)))) { |
| 76 ULONG_PTR phandle = NULL; | 76 ULONG_PTR phandle = NULL; |
| 77 DWORD id = GetCurrentProcessId(); | 77 DWORD id = GetCurrentProcessId(); |
| 78 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 78 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 79 if (!FAILED(ipl->LaunchCmdElevated(dist->GetAppGuid().c_str(), | 79 if (!FAILED(ipl->LaunchCmdElevated(dist->GetAppGuid().c_str(), |
| 80 google_update::kRegRenameCmdField, | 80 google_update::kRegRenameCmdField, |
| 81 id, &phandle))) { | 81 id, &phandle))) { |
| 82 HANDLE handle = HANDLE(phandle); | 82 HANDLE handle = HANDLE(phandle); |
| 83 WaitForSingleObject(handle, INFINITE); | 83 WaitForSingleObject(handle, INFINITE); |
| 84 DWORD exit_code; | 84 DWORD exit_code; |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 size_t version, | 824 size_t version, |
| 825 ProcessSingleton* process_singleton) { | 825 ProcessSingleton* process_singleton) { |
| 826 if (version > 10000) { | 826 if (version > 10000) { |
| 827 // This is a test value. We want to make sure we exercise | 827 // This is a test value. We want to make sure we exercise |
| 828 // returning this early. See EarlyReturnTest test harness. | 828 // returning this early. See EarlyReturnTest test harness. |
| 829 return Upgrade::TD_NOT_NOW; | 829 return Upgrade::TD_NOT_NOW; |
| 830 } | 830 } |
| 831 TryChromeDialog td(version); | 831 TryChromeDialog td(version); |
| 832 return td.ShowModal(process_singleton); | 832 return td.ShowModal(process_singleton); |
| 833 } | 833 } |
| OLD | NEW |