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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 9340007: Make the Chrome Web Store Icon Syncable (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixing chromeos compile problem Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 84397982cc4e10874b4d7d1a24dfd29d71d0adef..6d64e7e94b5b45b652ae48e23b7ee7802dca06e3 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1573,8 +1573,13 @@ void ExtensionService::SetIsIncognitoEnabled(
const std::string& extension_id, bool enabled) {
const Extension* extension = GetInstalledExtension(extension_id);
if (extension && extension->location() == Extension::COMPONENT) {
- // This shouldn't be called for component extensions.
- NOTREACHED();
+ // This shouldn't be called for component extensions unless they are
+ // syncable.
+ DCHECK(extension->IsSyncable());
+
+ // If we are here, make sure the we aren't trying to change the value.
+ DCHECK_EQ(enabled, IsIncognitoEnabled(extension_id));
+
return;
}
@@ -2050,6 +2055,12 @@ void ExtensionService::AddExtension(const Extension* extension) {
return;
}
+ // All apps that are displayed in the launcher are ordered by their ordinals
+ // so we must ensure they have valid ordinals.
+ if (extension->ShouldDisplayInLauncher()) {
Aaron Boodman 2012/02/09 19:17:37 Nit: Braces are not required for one-line ifs. In
csharp 2012/02/09 19:53:17 Done.
+ extension_prefs_->extension_sorting()->EnsureValidOrdinals(extension->id());
+ }
+
extensions_.Insert(scoped_extension);
SyncExtensionChangeIfNeeded(*extension);
NotifyExtensionLoaded(extension);
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698