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

Unified Diff: chrome/browser/extensions/default_apps.cc

Issue 10834191: new implementation of default apps (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/default_apps.cc
diff --git a/chrome/browser/extensions/default_apps.cc b/chrome/browser/extensions/default_apps.cc
index b7388bbb517977d34a74695b300187f45404fcc9..3f015bae3f380800a6bdf3592d3499df5ed41fb7 100644
--- a/chrome/browser/extensions/default_apps.cc
+++ b/chrome/browser/extensions/default_apps.cc
@@ -26,8 +26,6 @@ static bool ShouldInstallInProfile(Profile* profile) {
// - The command line option. Tests use this option to disable installation
// of default apps in some cases.
// - If the locale is not compatible with the defaults, don't install them.
- // - If the profile says to either always install or never install default
- // apps, obey.
// - The kDefaultApps preferences value in the profile. This value is
// usually set in the master_preferences file.
bool install_apps =
@@ -45,9 +43,9 @@ static bool ShouldInstallInProfile(Profile* profile) {
install_apps = false;
break;
}
+
case default_apps::kAlwaysProvideDefaultApps:
Mihai Parparita -not on Chrome 2012/08/08 00:22:42 It seems like in this case you'll want to migrate
Gaurav 2012/08/10 23:06:55 install_apps becomes true in most cases from the k
- install_apps = true;
- break;
+ case default_apps::kAlreadyInstalledDefaultApps:
case default_apps::kNeverProvideDefaultApps:
install_apps = false;
break;
@@ -80,22 +78,13 @@ static bool ShouldInstallInProfile(Profile* profile) {
kDefaultAppsTrialName)->group_name() != kDefaultAppsTrialNoAppsGroup;
}
- // Save the state if needed. Once it is decided whether we are installing
- // default apps or not, we want to always respond with same value. Therefore
- // on first run of this feature (i.e. the current state is kUnknown) the
- // state is updated to remember the choice that was made at this time. The
- // next time chrome runs it will use the same decision.
- //
- // The reason for responding with the same value is that once an external
- // extenson provider has provided apps for a given profile, it must continue
- // to provide those extensions on each subsequent run. Otherwise the
- // extension manager will automatically uninstall the apps. The extension
- // manager is smart enough to know not to reinstall the apps on all
- // subsequent runs of chrome.
+ // Default apps are only installed on profile creation or a new chrome
+ // download.
if (state == default_apps::kUnknown) {
if (install_apps) {
- profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState,
- default_apps::kAlwaysProvideDefaultApps);
+ profile->GetPrefs()->SetInteger(
+ prefs::kDefaultAppsInstallState,
+ default_apps::kAlreadyInstalledDefaultApps);
} else {
profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState,
default_apps::kNeverProvideDefaultApps);

Powered by Google App Engine
This is Rietveld 408576698