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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 11420045: Launch system-level Active Setup immediately following self-destruction of a user-level Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: grt comments -- only breakaway if in Metro Created 8 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 PostProfileInit(); 1190 PostProfileInit();
1191 1191
1192 #if !defined(OS_ANDROID) 1192 #if !defined(OS_ANDROID)
1193 // Show the First Run UI if this is the first time Chrome has been run on 1193 // Show the First Run UI if this is the first time Chrome has been run on
1194 // this computer, or we're being compelled to do so by a command line flag. 1194 // this computer, or we're being compelled to do so by a command line flag.
1195 // Note that this be done _after_ the PrefService is initialized and all 1195 // Note that this be done _after_ the PrefService is initialized and all
1196 // preferences are registered, since some of the code that the importer 1196 // preferences are registered, since some of the code that the importer
1197 // touches reads preferences. 1197 // touches reads preferences.
1198 if (is_first_run_) { 1198 if (is_first_run_) {
1199 #if defined(OS_WIN) 1199 #if defined(OS_WIN)
1200 // On Windows, trigger the Active Setup command in some scenarios to finish 1200 // On Windows, trigger the Active Setup command for system-level Chromes to
1201 // configuring this user's install (e.g. per-user shortcuts on system-level 1201 // finish configuring this user's install (e.g. per-user shortcuts).
1202 // installs).
1203 // Delay the task slightly to give Chrome launch I/O priority while also 1202 // Delay the task slightly to give Chrome launch I/O priority while also
1204 // making sure shortcuts are created promptly to avoid annoying the user by 1203 // making sure shortcuts are created promptly to avoid annoying the user by
1205 // re-creating shortcuts he previously deleted. 1204 // re-creating shortcuts he previously deleted.
1206 // TODO(gab): Add a first run section to ChromeBrowserMainParts and remove 1205 // TODO(gab): Add a first run section to ChromeBrowserMainParts and remove
1207 // OS specific sections below. 1206 // OS specific sections below.
Nico 2012/11/20 18:07:12 Sounds like a good opportunity to work on this TOD
gab 2012/11/20 20:42:11 Actually, this needs to merged in M24 so I want to
1208 static const int64 kTiggerActiveSetupDelaySeconds = 5; 1207 static const int64 kTiggerActiveSetupDelaySeconds = 5;
1209 BrowserThread::GetBlockingPool()->PostDelayedTask( 1208 FilePath chrome_exe;
1210 FROM_HERE, 1209 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
1211 base::Bind(&InstallUtil::TriggerActiveSetupCommandIfNeeded), 1210 NOTREACHED();
1212 base::TimeDelta::FromSeconds(kTiggerActiveSetupDelaySeconds)); 1211 } else if (!InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())) {
1212 BrowserThread::GetBlockingPool()->PostDelayedTask(
1213 FROM_HERE,
1214 base::Bind(&InstallUtil::TriggerActiveSetupCommand),
1215 base::TimeDelta::FromSeconds(kTiggerActiveSetupDelaySeconds));
1216 }
1213 #endif // OS_WIN 1217 #endif // OS_WIN
1214 if (!first_run_ui_bypass_) { 1218 if (!first_run_ui_bypass_) {
1215 first_run::AutoImport(profile_, 1219 first_run::AutoImport(profile_,
1216 master_prefs_->homepage_defined, 1220 master_prefs_->homepage_defined,
1217 master_prefs_->do_import_items, 1221 master_prefs_->do_import_items,
1218 master_prefs_->dont_import_items, 1222 master_prefs_->dont_import_items,
1219 master_prefs_->make_chrome_default, 1223 master_prefs_->make_chrome_default,
1220 process_singleton_.get()); 1224 process_singleton_.get());
1221 #if defined(OS_POSIX) && !defined(OS_CHROMEOS) 1225 #if defined(OS_POSIX) && !defined(OS_CHROMEOS)
1222 // On Windows, the download is tagged with enable/disable stats so there 1226 // On Windows, the download is tagged with enable/disable stats so there
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 if (base::win::GetVersion() <= base::win::VERSION_XP) 1720 if (base::win::GetVersion() <= base::win::VERSION_XP)
1717 uma_name += "_XP"; 1721 uma_name += "_XP";
1718 1722
1719 uma_name += "_PreRead_"; 1723 uma_name += "_PreRead_";
1720 uma_name += pre_read_percentage; 1724 uma_name += pre_read_percentage;
1721 AddPreReadHistogramTime(uma_name.c_str(), time); 1725 AddPreReadHistogramTime(uma_name.c_str(), time);
1722 } 1726 }
1723 #endif 1727 #endif
1724 #endif 1728 #endif
1725 } 1729 }
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/setup/uninstall.cc » ('j') | chrome/installer/util/install_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698