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

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

Issue 323843003: Add a do_not_sync pref to ExtensionPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for comments in #2 Created 6 years, 6 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/extension_util.h ('k') | chrome/common/extensions/sync_helper.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extension_util.h" 5 #include "chrome/browser/extensions/extension_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return !(ExtensionPrefs::Get(context)->GetDisableReasons(extension_id) & 173 return !(ExtensionPrefs::Get(context)->GetDisableReasons(extension_id) &
174 Extension::DISABLE_UNSUPPORTED_REQUIREMENT); 174 Extension::DISABLE_UNSUPPORTED_REQUIREMENT);
175 } 175 }
176 176
177 bool IsAppLaunchableWithoutEnabling(const std::string& extension_id, 177 bool IsAppLaunchableWithoutEnabling(const std::string& extension_id,
178 content::BrowserContext* context) { 178 content::BrowserContext* context) {
179 return ExtensionRegistry::Get(context)->GetExtensionById( 179 return ExtensionRegistry::Get(context)->GetExtensionById(
180 extension_id, ExtensionRegistry::ENABLED) != NULL; 180 extension_id, ExtensionRegistry::ENABLED) != NULL;
181 } 181 }
182 182
183 bool ShouldSyncExtension(const Extension* extension,
184 content::BrowserContext* context) {
185 return sync_helper::IsSyncableExtension(extension) &&
186 !ExtensionPrefs::Get(context)->DoNotSync(extension->id());
187 }
188
183 bool ShouldSyncApp(const Extension* app, content::BrowserContext* context) { 189 bool ShouldSyncApp(const Extension* app, content::BrowserContext* context) {
184 return sync_helper::IsSyncableApp(app) && 190 return sync_helper::IsSyncableApp(app) &&
185 !util::IsEphemeralApp(app->id(), context); 191 !util::IsEphemeralApp(app->id(), context) &&
192 !ExtensionPrefs::Get(context)->DoNotSync(app->id());
186 } 193 }
187 194
188 bool IsExtensionIdle(const std::string& extension_id, 195 bool IsExtensionIdle(const std::string& extension_id,
189 content::BrowserContext* context) { 196 content::BrowserContext* context) {
190 ProcessManager* process_manager = 197 ProcessManager* process_manager =
191 ExtensionSystem::Get(context)->process_manager(); 198 ExtensionSystem::Get(context)->process_manager();
192 DCHECK(process_manager); 199 DCHECK(process_manager);
193 ExtensionHost* host = 200 ExtensionHost* host =
194 process_manager->GetBackgroundHostForExtension(extension_id); 201 process_manager->GetBackgroundHostForExtension(extension_id);
195 if (host) 202 if (host)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 IDR_APP_DEFAULT_ICON); 279 IDR_APP_DEFAULT_ICON);
273 } 280 }
274 281
275 const gfx::ImageSkia& GetDefaultExtensionIcon() { 282 const gfx::ImageSkia& GetDefaultExtensionIcon() {
276 return *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 283 return *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
277 IDR_EXTENSION_DEFAULT_ICON); 284 IDR_EXTENSION_DEFAULT_ICON);
278 } 285 }
279 286
280 } // namespace util 287 } // namespace util
281 } // namespace extensions 288 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_util.h ('k') | chrome/common/extensions/sync_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698