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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
413 installer_state.UpdateStage(installer::REGISTERING_CHROME); | 414 installer_state.UpdateStage(installer::REGISTERING_CHROME); |
414 | 415 |
415 RegisterChromeOnMachine(installer_state, *chrome_install, | 416 RegisterChromeOnMachine(installer_state, *chrome_install, |
416 make_chrome_default || force_chrome_default_for_user); | 417 make_chrome_default || force_chrome_default_for_user); |
| 418 |
| 419 if (result == FIRST_INSTALL_SUCCESS) { |
| 420 installer_state.UpdateStage(installer::CONFIGURE_AUTO_LAUNCH); |
| 421 |
| 422 // Add auto-launch key if specified in master preferences. |
| 423 bool auto_launch_chrome = false; |
| 424 prefs.GetBool( |
| 425 installer::master_preferences::kAutoLaunchChrome, |
| 426 &auto_launch_chrome); |
| 427 if (auto_launch_chrome) { |
| 428 auto_launch_util::SetWillLaunchAtLogin( |
| 429 true, installer_state.target_path()); |
| 430 } |
| 431 } |
417 } | 432 } |
418 | 433 |
419 installer_state.UpdateStage(installer::REMOVING_OLD_VERSIONS); | 434 installer_state.UpdateStage(installer::REMOVING_OLD_VERSIONS); |
420 | 435 |
421 installer_state.RemoveOldVersionDirectories( | 436 installer_state.RemoveOldVersionDirectories( |
422 new_version, | 437 new_version, |
423 existing_version.get(), | 438 existing_version.get(), |
424 install_temp_path); | 439 install_temp_path); |
425 } | 440 } |
426 | 441 |
427 return result; | 442 return result; |
428 } | 443 } |
429 | 444 |
430 } // namespace installer | 445 } // namespace installer |
OLD | NEW |