Chromium Code Reviews| 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/installer/setup/install.h" | 5 #include "chrome/installer/setup/install.h" |
| 6 | 6 |
| 7 #include <shlobj.h> | 7 #include <shlobj.h> |
| 8 #include <time.h> | 8 #include <time.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 #include "chrome/installer/setup/setup_constants.h" | 19 #include "chrome/installer/setup/setup_constants.h" |
| 20 #include "chrome/installer/setup/install_worker.h" | 20 #include "chrome/installer/setup/install_worker.h" |
| 21 #include "chrome/installer/util/auto_launch_util.h" | |
| 21 #include "chrome/installer/util/browser_distribution.h" | 22 #include "chrome/installer/util/browser_distribution.h" |
| 22 #include "chrome/installer/util/create_reg_key_work_item.h" | 23 #include "chrome/installer/util/create_reg_key_work_item.h" |
| 23 #include "chrome/installer/util/delete_after_reboot_helper.h" | 24 #include "chrome/installer/util/delete_after_reboot_helper.h" |
| 24 #include "chrome/installer/util/google_update_constants.h" | 25 #include "chrome/installer/util/google_update_constants.h" |
| 25 #include "chrome/installer/util/helper.h" | 26 #include "chrome/installer/util/helper.h" |
| 26 #include "chrome/installer/util/install_util.h" | 27 #include "chrome/installer/util/install_util.h" |
| 27 #include "chrome/installer/util/installation_state.h" | 28 #include "chrome/installer/util/installation_state.h" |
| 28 #include "chrome/installer/util/installer_state.h" | 29 #include "chrome/installer/util/installer_state.h" |
| 29 #include "chrome/installer/util/master_preferences.h" | 30 #include "chrome/installer/util/master_preferences.h" |
| 30 #include "chrome/installer/util/master_preferences_constants.h" | 31 #include "chrome/installer/util/master_preferences_constants.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 // Chrome to become their default browser on the download page, we must | 404 // Chrome to become their default browser on the download page, we must |
| 404 // force it here because the master_preferences file will not get copied | 405 // force it here because the master_preferences file will not get copied |
| 405 // into the build. | 406 // into the build. |
| 406 bool force_chrome_default_for_user = false; | 407 bool force_chrome_default_for_user = false; |
| 407 if (result == NEW_VERSION_UPDATED || | 408 if (result == NEW_VERSION_UPDATED || |
| 408 result == INSTALL_REPAIRED) { | 409 result == INSTALL_REPAIRED) { |
| 409 prefs.GetBool(master_preferences::kMakeChromeDefaultForUser, | 410 prefs.GetBool(master_preferences::kMakeChromeDefaultForUser, |
| 410 &force_chrome_default_for_user); | 411 &force_chrome_default_for_user); |
| 411 } | 412 } |
| 412 | 413 |
| 414 if (result == FIRST_INSTALL_SUCCESS) { | |
|
grt (UTC plus 2)
2011/12/01 04:45:02
move this new code below the call to RegisterChrom
| |
| 415 // Add auto-launch key if specified in master preferences. | |
| 416 bool auto_launch_chrome = false; | |
| 417 prefs.GetBool( | |
| 418 installer::master_preferences::kAutoLaunchChrome, | |
| 419 &auto_launch_chrome); | |
| 420 if (auto_launch_chrome) { | |
| 421 auto_launch_util::SetWillLaunchAtLogin( | |
| 422 true, installer_state.target_path()); | |
| 423 } | |
| 424 } | |
| 425 | |
| 413 installer_state.UpdateStage(installer::REGISTERING_CHROME); | 426 installer_state.UpdateStage(installer::REGISTERING_CHROME); |
| 414 | 427 |
| 415 RegisterChromeOnMachine(installer_state, *chrome_install, | 428 RegisterChromeOnMachine(installer_state, *chrome_install, |
| 416 make_chrome_default || force_chrome_default_for_user); | 429 make_chrome_default || force_chrome_default_for_user); |
| 417 } | 430 } |
| 418 | 431 |
| 419 installer_state.UpdateStage(installer::REMOVING_OLD_VERSIONS); | 432 installer_state.UpdateStage(installer::REMOVING_OLD_VERSIONS); |
| 420 | 433 |
| 421 installer_state.RemoveOldVersionDirectories( | 434 installer_state.RemoveOldVersionDirectories( |
| 422 new_version, | 435 new_version, |
| 423 existing_version.get(), | 436 existing_version.get(), |
| 424 install_temp_path); | 437 install_temp_path); |
| 425 } | 438 } |
| 426 | 439 |
| 427 return result; | 440 return result; |
| 428 } | 441 } |
| 429 | 442 |
| 430 } // namespace installer | 443 } // namespace installer |
| OLD | NEW |