OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 from_webstore, | 2603 from_webstore, |
2604 page_index); | 2604 page_index); |
2605 | 2605 |
2606 // Unpacked extensions default to allowing file access, but if that has been | 2606 // Unpacked extensions default to allowing file access, but if that has been |
2607 // overridden, don't reset the value. | 2607 // overridden, don't reset the value. |
2608 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) && | 2608 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) && |
2609 !extension_prefs_->HasAllowFileAccessSetting(id)) { | 2609 !extension_prefs_->HasAllowFileAccessSetting(id)) { |
2610 extension_prefs_->SetAllowFileAccess(id, true); | 2610 extension_prefs_->SetAllowFileAccess(id, true); |
2611 } | 2611 } |
2612 | 2612 |
| 2613 // If the extension should automatically block network startup (e.g., it uses |
| 2614 // the webRequest API), set the preference. Otherwise clear it, in case the |
| 2615 // extension stopped using a relevant API. |
| 2616 extension_prefs_->SetDelaysNetworkRequests( |
| 2617 extension->id(), extension->ImplicitlyDelaysNetworkStartup()); |
| 2618 |
2613 NotificationService::current()->Notify( | 2619 NotificationService::current()->Notify( |
2614 chrome::NOTIFICATION_EXTENSION_INSTALLED, | 2620 chrome::NOTIFICATION_EXTENSION_INSTALLED, |
2615 Source<Profile>(profile_), | 2621 Source<Profile>(profile_), |
2616 Details<const Extension>(extension)); | 2622 Details<const Extension>(extension)); |
2617 | 2623 |
2618 // Transfer ownership of |extension| to AddExtension. | 2624 // Transfer ownership of |extension| to AddExtension. |
2619 AddExtension(scoped_extension); | 2625 AddExtension(scoped_extension); |
2620 } | 2626 } |
2621 | 2627 |
2622 const Extension* ExtensionService::GetExtensionByIdInternal( | 2628 const Extension* ExtensionService::GetExtensionByIdInternal( |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3002 | 3008 |
3003 ExtensionService::NaClModuleInfoList::iterator | 3009 ExtensionService::NaClModuleInfoList::iterator |
3004 ExtensionService::FindNaClModule(const GURL& url) { | 3010 ExtensionService::FindNaClModule(const GURL& url) { |
3005 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 3011 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
3006 iter != nacl_module_list_.end(); ++iter) { | 3012 iter != nacl_module_list_.end(); ++iter) { |
3007 if (iter->url == url) | 3013 if (iter->url == url) |
3008 return iter; | 3014 return iter; |
3009 } | 3015 } |
3010 return nacl_module_list_.end(); | 3016 return nacl_module_list_.end(); |
3011 } | 3017 } |
OLD | NEW |