diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-14 20:28:05 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-14 20:28:05 +0000 |
commit | 658eae5c45ea3e7f99741d84962434ecc782a038 (patch) | |
tree | 21fea6d0ea56bd04b4348b0e327bec6bacde4af7 /chrome/browser/extensions/extension_util.cc | |
parent | 986dd0ea53fe19d2ff9ffe7a41b71c3d8bfbd926 (diff) | |
download | chromium_src-658eae5c45ea3e7f99741d84962434ecc782a038.zip chromium_src-658eae5c45ea3e7f99741d84962434ecc782a038.tar.gz chromium_src-658eae5c45ea3e7f99741d84962434ecc782a038.tar.bz2 |
Add a do_not_sync pref to ExtensionPrefs.
Split from https://codereview.chromium.org/308003005/ for extensions
system changes that allows to install a none syncable Extension.
- Add a do_not_sync pref to ExtensionPrefs;
- Add a kInstallFlagDoNotSync that CrxInstaller uses to initialize the pref;
- Update util::ShouldSyncApp and add ShouldSyncExtension to use the pref to skip sync in ExtensionSyncService;
BUG=358791
Review URL: https://codereview.chromium.org/323843003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_util.cc')
-rw-r--r-- | chrome/browser/extensions/extension_util.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc index dd28913..45dc740 100644 --- a/chrome/browser/extensions/extension_util.cc +++ b/chrome/browser/extensions/extension_util.cc @@ -180,9 +180,16 @@ bool IsAppLaunchableWithoutEnabling(const std::string& extension_id, extension_id, ExtensionRegistry::ENABLED) != NULL; } +bool ShouldSyncExtension(const Extension* extension, + content::BrowserContext* context) { + return sync_helper::IsSyncableExtension(extension) && + !ExtensionPrefs::Get(context)->DoNotSync(extension->id()); +} + bool ShouldSyncApp(const Extension* app, content::BrowserContext* context) { return sync_helper::IsSyncableApp(app) && - !util::IsEphemeralApp(app->id(), context); + !util::IsEphemeralApp(app->id(), context) && + !ExtensionPrefs::Get(context)->DoNotSync(app->id()); } bool IsExtensionIdle(const std::string& extension_id, |