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 2483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2494 from_webstore, | 2494 from_webstore, |
2495 page_index); | 2495 page_index); |
2496 | 2496 |
2497 // Unpacked extensions default to allowing file access, but if that has been | 2497 // Unpacked extensions default to allowing file access, but if that has been |
2498 // overridden, don't reset the value. | 2498 // overridden, don't reset the value. |
2499 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) && | 2499 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) && |
2500 !extension_prefs_->HasAllowFileAccessSetting(id)) { | 2500 !extension_prefs_->HasAllowFileAccessSetting(id)) { |
2501 extension_prefs_->SetAllowFileAccess(id, true); | 2501 extension_prefs_->SetAllowFileAccess(id, true); |
2502 } | 2502 } |
2503 | 2503 |
| 2504 // If the extension should automatically block network startup (e.g., it uses |
| 2505 // the webRequest API), set the preference. Otherwise clear it, in case the |
| 2506 // extension stopped using a relevant API. |
| 2507 extension_prefs_->SetDelaysNetworkRequests( |
| 2508 extension->id(), extension->ImplicitlyDelaysNetworkStartup()); |
| 2509 |
2504 NotificationService::current()->Notify( | 2510 NotificationService::current()->Notify( |
2505 chrome::NOTIFICATION_EXTENSION_INSTALLED, | 2511 chrome::NOTIFICATION_EXTENSION_INSTALLED, |
2506 Source<Profile>(profile_), | 2512 Source<Profile>(profile_), |
2507 Details<const Extension>(extension)); | 2513 Details<const Extension>(extension)); |
2508 | 2514 |
2509 // Transfer ownership of |extension| to AddExtension. | 2515 // Transfer ownership of |extension| to AddExtension. |
2510 AddExtension(scoped_extension); | 2516 AddExtension(scoped_extension); |
2511 } | 2517 } |
2512 | 2518 |
2513 const Extension* ExtensionService::GetExtensionByIdInternal( | 2519 const Extension* ExtensionService::GetExtensionByIdInternal( |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2894 | 2900 |
2895 ExtensionService::NaClModuleInfoList::iterator | 2901 ExtensionService::NaClModuleInfoList::iterator |
2896 ExtensionService::FindNaClModule(const GURL& url) { | 2902 ExtensionService::FindNaClModule(const GURL& url) { |
2897 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2903 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2898 iter != nacl_module_list_.end(); ++iter) { | 2904 iter != nacl_module_list_.end(); ++iter) { |
2899 if (iter->url == url) | 2905 if (iter->url == url) |
2900 return iter; | 2906 return iter; |
2901 } | 2907 } |
2902 return nacl_module_list_.end(); | 2908 return nacl_module_list_.end(); |
2903 } | 2909 } |
OLD | NEW |