| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2184 | 2184 |
| 2185 void ExtensionService::MaybeWipeout( | 2185 void ExtensionService::MaybeWipeout( |
| 2186 const extensions::Extension* extension) { | 2186 const extensions::Extension* extension) { |
| 2187 if (!FeatureSwitch::sideload_wipeout()->IsEnabled()) | 2187 if (!FeatureSwitch::sideload_wipeout()->IsEnabled()) |
| 2188 return; | 2188 return; |
| 2189 | 2189 |
| 2190 bool done = extension_prefs_->GetSideloadWipeoutDone(); | 2190 bool done = extension_prefs_->GetSideloadWipeoutDone(); |
| 2191 if (done) | 2191 if (done) |
| 2192 return; | 2192 return; |
| 2193 | 2193 |
| 2194 Extension::Type type = extension->GetType(); |
| 2194 int disable_reasons = extension_prefs_->GetDisableReasons(extension->id()); | 2195 int disable_reasons = extension_prefs_->GetDisableReasons(extension->id()); |
| 2195 if (disable_reasons == Extension::DISABLE_NONE) { | 2196 if (disable_reasons == Extension::DISABLE_NONE && |
| 2197 type == Extension::TYPE_EXTENSION) { |
| 2196 Extension::Location location = extension->location(); | 2198 Extension::Location location = extension->location(); |
| 2197 if (location == Extension::EXTERNAL_REGISTRY || | 2199 if (location == Extension::EXTERNAL_REGISTRY || |
| 2198 (location == Extension::INTERNAL && !extension->from_webstore())) { | 2200 (location == Extension::INTERNAL && !extension->from_webstore())) { |
| 2199 extension_prefs_->SetExtensionState(extension->id(), Extension::DISABLED); | 2201 extension_prefs_->SetExtensionState(extension->id(), Extension::DISABLED); |
| 2200 extension_prefs_->AddDisableReason( | 2202 extension_prefs_->AddDisableReason( |
| 2201 extension->id(), | 2203 extension->id(), |
| 2202 static_cast<Extension::DisableReason>( | 2204 static_cast<Extension::DisableReason>( |
| 2203 Extension::DISABLE_SIDELOAD_WIPEOUT)); | 2205 Extension::DISABLE_SIDELOAD_WIPEOUT)); |
| 2204 } | 2206 } |
| 2205 } | 2207 } |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2785 // enabling them. | 2787 // enabling them. |
| 2786 if (Extension::IsExternalLocation(extension->location()) && | 2788 if (Extension::IsExternalLocation(extension->location()) && |
| 2787 !extension_prefs_->IsExternalExtensionAcknowledged(extension->id())) { | 2789 !extension_prefs_->IsExternalExtensionAcknowledged(extension->id())) { |
| 2788 return false; | 2790 return false; |
| 2789 } | 2791 } |
| 2790 } | 2792 } |
| 2791 #endif | 2793 #endif |
| 2792 | 2794 |
| 2793 return true; | 2795 return true; |
| 2794 } | 2796 } |
| OLD | NEW |