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/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 // Show the extension disabled error if a permissions increase was the | 2095 // Show the extension disabled error if a permissions increase was the |
2096 // only reason it was disabled. | 2096 // only reason it was disabled. |
2097 if (extension_prefs_->GetDisableReasons(extension->id()) == | 2097 if (extension_prefs_->GetDisableReasons(extension->id()) == |
2098 Extension::DISABLE_PERMISSIONS_INCREASE) { | 2098 Extension::DISABLE_PERMISSIONS_INCREASE) { |
2099 extensions::AddExtensionDisabledError(this, extension); | 2099 extensions::AddExtensionDisabledError(this, extension); |
2100 } | 2100 } |
2101 } else { | 2101 } else { |
2102 // All apps that are displayed in the launcher are ordered by their ordinals | 2102 // All apps that are displayed in the launcher are ordered by their ordinals |
2103 // so we must ensure they have valid ordinals. | 2103 // so we must ensure they have valid ordinals. |
2104 if (extension->RequiresSortOrdinal()) { | 2104 if (extension->RequiresSortOrdinal()) { |
| 2105 if (!extension->ShouldDisplayInNewTabPage()) { |
| 2106 extension_prefs_->extension_sorting()->MarkExtensionAsHidden( |
| 2107 extension->id()); |
| 2108 } |
2105 extension_prefs_->extension_sorting()->EnsureValidOrdinals( | 2109 extension_prefs_->extension_sorting()->EnsureValidOrdinals( |
2106 extension->id(), syncer::StringOrdinal()); | 2110 extension->id(), syncer::StringOrdinal()); |
2107 } | 2111 } |
2108 | 2112 |
2109 extensions_.Insert(extension); | 2113 extensions_.Insert(extension); |
2110 SyncExtensionChangeIfNeeded(*extension); | 2114 SyncExtensionChangeIfNeeded(*extension); |
2111 NotifyExtensionLoaded(extension); | 2115 NotifyExtensionLoaded(extension); |
2112 DoPostLoadTasks(extension); | 2116 DoPostLoadTasks(extension); |
2113 } | 2117 } |
2114 } | 2118 } |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3103 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); | 3107 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); |
3104 DCHECK(extension); | 3108 DCHECK(extension); |
3105 if (!extension) | 3109 if (!extension) |
3106 continue; | 3110 continue; |
3107 blacklisted_extensions_.Insert(extension); | 3111 blacklisted_extensions_.Insert(extension); |
3108 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); | 3112 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); |
3109 } | 3113 } |
3110 | 3114 |
3111 IdentifyAlertableExtensions(); | 3115 IdentifyAlertableExtensions(); |
3112 } | 3116 } |
OLD | NEW |