Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 8205001: (Owner approval for) Delay network requests on startup if any webRequest ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Resync, fix compile errors Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after
2616 from_webstore, 2616 from_webstore,
2617 page_index); 2617 page_index);
2618 2618
2619 // Unpacked extensions default to allowing file access, but if that has been 2619 // Unpacked extensions default to allowing file access, but if that has been
2620 // overridden, don't reset the value. 2620 // overridden, don't reset the value.
2621 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) && 2621 if (Extension::ShouldAlwaysAllowFileAccess(extension->location()) &&
2622 !extension_prefs_->HasAllowFileAccessSetting(id)) { 2622 !extension_prefs_->HasAllowFileAccessSetting(id)) {
2623 extension_prefs_->SetAllowFileAccess(id, true); 2623 extension_prefs_->SetAllowFileAccess(id, true);
2624 } 2624 }
2625 2625
2626 // If the extension should automatically block network startup (e.g., it uses
2627 // the webRequest API), set the preference. Otherwise clear it, in case the
2628 // extension stopped using a relevant API.
2629 extension_prefs_->SetDelaysNetworkRequests(
2630 extension->id(), extension->ImplicitlyDelaysNetworkStartup());
2631
2626 NotificationService::current()->Notify( 2632 NotificationService::current()->Notify(
2627 chrome::NOTIFICATION_EXTENSION_INSTALLED, 2633 chrome::NOTIFICATION_EXTENSION_INSTALLED,
2628 Source<Profile>(profile_), 2634 Source<Profile>(profile_),
2629 Details<const Extension>(extension)); 2635 Details<const Extension>(extension));
2630 2636
2631 // Transfer ownership of |extension| to AddExtension. 2637 // Transfer ownership of |extension| to AddExtension.
2632 AddExtension(scoped_extension); 2638 AddExtension(scoped_extension);
2633 } 2639 }
2634 2640
2635 const Extension* ExtensionService::GetExtensionByIdInternal( 2641 const Extension* ExtensionService::GetExtensionByIdInternal(
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
3016 3022
3017 ExtensionService::NaClModuleInfoList::iterator 3023 ExtensionService::NaClModuleInfoList::iterator
3018 ExtensionService::FindNaClModule(const GURL& url) { 3024 ExtensionService::FindNaClModule(const GURL& url) {
3019 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); 3025 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin();
3020 iter != nacl_module_list_.end(); ++iter) { 3026 iter != nacl_module_list_.end(); ++iter) {
3021 if (iter->url == url) 3027 if (iter->url == url)
3022 return iter; 3028 return iter;
3023 } 3029 }
3024 return nacl_module_list_.end(); 3030 return nacl_module_list_.end();
3025 } 3031 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698