Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Side by Side Diff: chrome/installer/setup/install.cc

Issue 8729009: Implement an AutoLaunch experiment for Chrome for certain brand codes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/pref_names.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 if (result == NEW_VERSION_UPDATED || 405 if (result == NEW_VERSION_UPDATED ||
405 result == INSTALL_REPAIRED) { 406 result == INSTALL_REPAIRED) {
406 prefs.GetBool(master_preferences::kMakeChromeDefaultForUser, 407 prefs.GetBool(master_preferences::kMakeChromeDefaultForUser,
407 &force_chrome_default_for_user); 408 &force_chrome_default_for_user);
408 } 409 }
409 410
410 installer_state.UpdateStage(installer::REGISTERING_CHROME); 411 installer_state.UpdateStage(installer::REGISTERING_CHROME);
411 412
412 RegisterChromeOnMachine(installer_state, *chrome_install, 413 RegisterChromeOnMachine(installer_state, *chrome_install,
413 make_chrome_default || force_chrome_default_for_user); 414 make_chrome_default || force_chrome_default_for_user);
415
416 if (result == FIRST_INSTALL_SUCCESS) {
417 installer_state.UpdateStage(installer::CONFIGURE_AUTO_LAUNCH);
418
419 // Add auto-launch key if specified in master preferences.
420 bool auto_launch_chrome = false;
421 prefs.GetBool(
422 installer::master_preferences::kAutoLaunchChrome,
423 &auto_launch_chrome);
424 if (auto_launch_chrome) {
425 auto_launch_util::SetWillLaunchAtLogin(
426 true, installer_state.target_path());
427 }
428 }
414 } 429 }
415 430
416 installer_state.UpdateStage(installer::REMOVING_OLD_VERSIONS); 431 installer_state.UpdateStage(installer::REMOVING_OLD_VERSIONS);
417 432
418 installer_state.RemoveOldVersionDirectories( 433 installer_state.RemoveOldVersionDirectories(
419 new_version, 434 new_version,
420 existing_version.get(), 435 existing_version.get(),
421 install_temp_path); 436 install_temp_path);
422 } 437 }
423 438
424 return result; 439 return result;
425 } 440 }
426 441
427 } // namespace installer 442 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/common/pref_names.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698