OLD | NEW |
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/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 "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #if !defined(OS_ANDROID) | 9 #if !defined(OS_ANDROID) |
10 #include "chrome/browser/first_run/first_run.h" | 10 #include "chrome/browser/first_run/first_run.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 return false; | 41 return false; |
42 } | 42 } |
43 } | 43 } |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 namespace default_apps { | 49 namespace default_apps { |
50 | 50 |
51 void RegisterUserPrefs(PrefService* prefs) { | 51 void RegisterUserPrefs(PrefServiceSyncable* prefs) { |
52 prefs->RegisterIntegerPref(prefs::kDefaultAppsInstallState, kUnknown, | 52 prefs->RegisterIntegerPref(prefs::kDefaultAppsInstallState, kUnknown, |
53 PrefService::UNSYNCABLE_PREF); | 53 PrefServiceSyncable::UNSYNCABLE_PREF); |
54 } | 54 } |
55 | 55 |
56 bool Provider::ShouldInstallInProfile() { | 56 bool Provider::ShouldInstallInProfile() { |
57 // We decide to install or not install default apps based on the following | 57 // We decide to install or not install default apps based on the following |
58 // criteria, from highest priority to lowest priority: | 58 // criteria, from highest priority to lowest priority: |
59 // | 59 // |
60 // - The command line option. Tests use this option to disable installation | 60 // - The command line option. Tests use this option to disable installation |
61 // of default apps in some cases. | 61 // of default apps in some cases. |
62 // - If the locale is not compatible with the defaults, don't install them. | 62 // - If the locale is not compatible with the defaults, don't install them. |
63 // - The kDefaultApps preferences value in the profile. This value is | 63 // - The kDefaultApps preferences value in the profile. This value is |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 for (std::set<std::string>::iterator it = new_default_apps.begin(); | 166 for (std::set<std::string>::iterator it = new_default_apps.begin(); |
167 it != new_default_apps.end(); ++it) { | 167 it != new_default_apps.end(); ++it) { |
168 prefs->Remove(*it, NULL); | 168 prefs->Remove(*it, NULL); |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 ExternalProviderImpl::SetPrefs(prefs); | 172 ExternalProviderImpl::SetPrefs(prefs); |
173 } | 173 } |
174 | 174 |
175 } // namespace default_apps | 175 } // namespace default_apps |
OLD | NEW |