| 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 2234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2245 | 2245 |
| 2246 bool ExtensionService::OnExternalExtensionFileFound( | 2246 bool ExtensionService::OnExternalExtensionFileFound( |
| 2247 const std::string& id, | 2247 const std::string& id, |
| 2248 const Version* version, | 2248 const Version* version, |
| 2249 const FilePath& path, | 2249 const FilePath& path, |
| 2250 Extension::Location location, | 2250 Extension::Location location, |
| 2251 int creation_flags, | 2251 int creation_flags, |
| 2252 bool mark_acknowledged) { | 2252 bool mark_acknowledged) { |
| 2253 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2253 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 2254 CHECK(Extension::IdIsValid(id)); | 2254 CHECK(Extension::IdIsValid(id)); |
| 2255 if (extension_prefs_->IsExternalExtensionUninstalled(id)) | 2255 |
| 2256 return false; | 2256 // The default apps use the external extensions installer but are installed |
| 2257 // as internal. |
| 2258 if (location != Extension::INTERNAL) { |
| 2259 if (extension_prefs_->IsExternalExtensionUninstalled(id)) |
| 2260 return false; |
| 2261 } |
| 2257 | 2262 |
| 2258 DCHECK(version); | 2263 DCHECK(version); |
| 2259 | 2264 |
| 2260 // Before even bothering to unpack, check and see if we already have this | 2265 // Before even bothering to unpack, check and see if we already have this |
| 2261 // version. This is important because these extensions are going to get | 2266 // version. This is important because these extensions are going to get |
| 2262 // installed on every startup. | 2267 // installed on every startup. |
| 2263 const Extension* existing = GetExtensionById(id, true); | 2268 const Extension* existing = GetExtensionById(id, true); |
| 2264 if (existing) { | 2269 if (existing) { |
| 2265 switch (existing->version()->CompareTo(*version)) { | 2270 switch (existing->version()->CompareTo(*version)) { |
| 2266 case -1: // existing version is older, we should upgrade | 2271 case -1: // existing version is older, we should upgrade |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2546 | 2551 |
| 2547 ExtensionService::NaClModuleInfoList::iterator | 2552 ExtensionService::NaClModuleInfoList::iterator |
| 2548 ExtensionService::FindNaClModule(const GURL& url) { | 2553 ExtensionService::FindNaClModule(const GURL& url) { |
| 2549 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2554 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
| 2550 iter != nacl_module_list_.end(); ++iter) { | 2555 iter != nacl_module_list_.end(); ++iter) { |
| 2551 if (iter->url == url) | 2556 if (iter->url == url) |
| 2552 return iter; | 2557 return iter; |
| 2553 } | 2558 } |
| 2554 return nacl_module_list_.end(); | 2559 return nacl_module_list_.end(); |
| 2555 } | 2560 } |
| OLD | NEW |