| OLD | NEW |
| 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/browser/extensions/default_apps.h" | 5 #include "chrome/browser/extensions/default_apps.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/first_run/first_run.h" | 10 #include "chrome/browser/first_run/first_run.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // manager is smart enough to know not to reinstall the apps on all | 95 // manager is smart enough to know not to reinstall the apps on all |
| 96 // subsequent runs of chrome. | 96 // subsequent runs of chrome. |
| 97 if (state == default_apps::kUnknown) { | 97 if (state == default_apps::kUnknown) { |
| 98 if (install_apps) { | 98 if (install_apps) { |
| 99 profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, | 99 profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, |
| 100 default_apps::kAlwaysProvideDefaultApps); | 100 default_apps::kAlwaysProvideDefaultApps); |
| 101 } else { | 101 } else { |
| 102 profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, | 102 profile->GetPrefs()->SetInteger(prefs::kDefaultAppsInstallState, |
| 103 default_apps::kNeverProvideDefaultApps); | 103 default_apps::kNeverProvideDefaultApps); |
| 104 } | 104 } |
| 105 profile->GetPrefs()->ScheduleSavePersistentPrefs(); | |
| 106 } | 105 } |
| 107 | 106 |
| 108 return install_apps; | 107 return install_apps; |
| 109 } | 108 } |
| 110 | 109 |
| 111 namespace default_apps { | 110 namespace default_apps { |
| 112 | 111 |
| 113 void RegisterUserPrefs(PrefService* prefs) { | 112 void RegisterUserPrefs(PrefService* prefs) { |
| 114 prefs->RegisterIntegerPref(prefs::kDefaultAppsInstallState, kUnknown, | 113 prefs->RegisterIntegerPref(prefs::kDefaultAppsInstallState, kUnknown, |
| 115 PrefService::UNSYNCABLE_PREF); | 114 PrefService::UNSYNCABLE_PREF); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 132 if (!profile_ || !ShouldInstallInProfile(profile_)) { | 131 if (!profile_ || !ShouldInstallInProfile(profile_)) { |
| 133 base::DictionaryValue* prefs = new base::DictionaryValue; | 132 base::DictionaryValue* prefs = new base::DictionaryValue; |
| 134 SetPrefs(prefs); | 133 SetPrefs(prefs); |
| 135 return; | 134 return; |
| 136 } | 135 } |
| 137 | 136 |
| 138 ExternalExtensionProviderImpl::VisitRegisteredExtension(); | 137 ExternalExtensionProviderImpl::VisitRegisteredExtension(); |
| 139 } | 138 } |
| 140 | 139 |
| 141 } // namespace default_apps | 140 } // namespace default_apps |
| OLD | NEW |