Chromium Code Reviews| 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); |