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

Side by Side Diff: chrome/browser/extensions/default_apps.cc

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again; base::File changes conflicted. Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/default_apps.h ('k') | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/prefs/pref_registry_syncable.h"
9 #if !defined(OS_ANDROID) 10 #if !defined(OS_ANDROID)
10 #include "chrome/browser/first_run/first_run.h" 11 #include "chrome/browser/first_run/first_run.h"
11 #endif 12 #endif
12 #include "chrome/browser/prefs/pref_service.h" 13 #include "chrome/browser/prefs/pref_service.h"
13 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/chrome_version_info.h" 16 #include "chrome/common/chrome_version_info.h"
16 #include "chrome/common/extensions/extension.h" 17 #include "chrome/common/extensions/extension.h"
17 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
18 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
(...skipping 22 matching lines...) Expand all
41 return false; 42 return false;
42 } 43 }
43 } 44 }
44 return true; 45 return true;
45 } 46 }
46 47
47 } // namespace 48 } // namespace
48 49
49 namespace default_apps { 50 namespace default_apps {
50 51
51 void RegisterUserPrefs(PrefServiceSyncable* prefs) { 52 void RegisterUserPrefs(PrefRegistrySyncable* registry) {
52 prefs->RegisterIntegerPref(prefs::kDefaultAppsInstallState, kUnknown, 53 registry->RegisterIntegerPref(prefs::kDefaultAppsInstallState, kUnknown,
53 PrefServiceSyncable::UNSYNCABLE_PREF); 54 PrefRegistrySyncable::UNSYNCABLE_PREF);
54 } 55 }
55 56
56 bool Provider::ShouldInstallInProfile() { 57 bool Provider::ShouldInstallInProfile() {
57 // We decide to install or not install default apps based on the following 58 // We decide to install or not install default apps based on the following
58 // criteria, from highest priority to lowest priority: 59 // criteria, from highest priority to lowest priority:
59 // 60 //
60 // - The command line option. Tests use this option to disable installation 61 // - The command line option. Tests use this option to disable installation
61 // of default apps in some cases. 62 // of default apps in some cases.
62 // - If the locale is not compatible with the defaults, don't install them. 63 // - If the locale is not compatible with the defaults, don't install them.
63 // - The kDefaultApps preferences value in the profile. This value is 64 // - The kDefaultApps preferences value in the profile. This value is
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 for (std::set<std::string>::iterator it = new_default_apps.begin(); 167 for (std::set<std::string>::iterator it = new_default_apps.begin();
167 it != new_default_apps.end(); ++it) { 168 it != new_default_apps.end(); ++it) {
168 prefs->Remove(*it, NULL); 169 prefs->Remove(*it, NULL);
169 } 170 }
170 } 171 }
171 172
172 ExternalProviderImpl::SetPrefs(prefs); 173 ExternalProviderImpl::SetPrefs(prefs);
173 } 174 }
174 175
175 } // namespace default_apps 176 } // namespace default_apps
OLDNEW
« no previous file with comments | « chrome/browser/extensions/default_apps.h ('k') | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698