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

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

Issue 10875065: Disable install of new default_apps for existing users (Closed) Base URL: http://git.chromium.org/git/chromium.git@disable_sync_behav
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 31762906b121cdb5b6cc70d9f204879bd31ced62..a37fadc4a256af80666fd0d1c7226963169355fb 100644
--- a/chrome/browser/extensions/default_apps.cc
+++ b/chrome/browser/extensions/default_apps.cc
@@ -19,6 +19,8 @@
namespace default_apps {
+bool isMigration;
+
bool ShouldInstallInProfile(Profile* profile) {
// We decide to install or not install default apps based on the following
// criteria, from highest priority to lowest priority:
@@ -33,12 +35,14 @@ bool ShouldInstallInProfile(Profile* profile) {
bool install_apps =
profile->GetPrefs()->GetString(prefs::kDefaultApps) == "install";
- default_apps::InstallState state =
- static_cast<default_apps::InstallState>(profile->GetPrefs()->GetInteger(
+ InstallState state =
+ static_cast<InstallState>(profile->GetPrefs()->GetInteger(
prefs::kDefaultAppsInstallState));
+ isMigration = (state == kProvideLegacyDefaultApps);
+
switch (state) {
- case default_apps::kUnknown: {
+ case kUnknown: {
// This is the first time the default apps feature runs on this profile.
// Determine if we want to install them or not.
chrome::VersionInfo version_info;
@@ -52,14 +56,14 @@ bool ShouldInstallInProfile(Profile* profile) {
// apps affected all users. Migrate old default apps to new mechanism where
// they are installed only once as INTERNAL.
// TODO(grv) : remove after Q1-2013.
- case default_apps::kProvideLegacyDefaultApps:
+ case kProvideLegacyDefaultApps:
profile->GetPrefs()->SetInteger(
prefs::kDefaultAppsInstallState,
- default_apps::kAlreadyInstalledDefaultApps);
+ kAlreadyInstalledDefaultApps);
break;
- case default_apps::kAlreadyInstalledDefaultApps:
- case default_apps::kNeverInstallDefaultApps:
+ case kAlreadyInstalledDefaultApps:
+ case kNeverInstallDefaultApps:
install_apps = false;
break;
default:
@@ -82,14 +86,14 @@ bool ShouldInstallInProfile(Profile* profile) {
// Default apps are only installed on profile creation or a new chrome
// download.
- if (state == default_apps::kUnknown) {
+ if (state == kUnknown) {
if (install_apps) {
profile->GetPrefs()->SetInteger(
prefs::kDefaultAppsInstallState,
- default_apps::kAlreadyInstalledDefaultApps);
+ kAlreadyInstalledDefaultApps);
} else {
profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState,
- default_apps::kNeverInstallDefaultApps);
+ kNeverInstallDefaultApps);
}
}

Powered by Google App Engine
This is Rietveld 408576698