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

Side by Side Diff: chrome/common/extensions/extension.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: '' 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/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 2819 matching lines...) Expand 10 before | Expand all | Expand 10 after
2830 } 2830 }
2831 2831
2832 bool Extension::ShowConfigureContextMenus() const { 2832 bool Extension::ShowConfigureContextMenus() const {
2833 // Don't show context menu for component extensions. We might want to show 2833 // Don't show context menu for component extensions. We might want to show
2834 // options for component extension button but now there is no component 2834 // options for component extension button but now there is no component
2835 // extension with options. All other menu items like uninstall have 2835 // extension with options. All other menu items like uninstall have
2836 // no sense for component extensions. 2836 // no sense for component extensions.
2837 return location() != Extension::COMPONENT; 2837 return location() != Extension::COMPONENT;
2838 } 2838 }
2839 2839
2840 bool Extension::ImplicitlyDelaysNetworkStartup() const {
2841 // Network requests should be deferred until any extensions that might want
2842 // to observe or modify them are loaded.
2843 return HasAPIPermission(ExtensionAPIPermission::kWebNavigation) ||
2844 HasAPIPermission(ExtensionAPIPermission::kWebRequest);
2845 }
2846
2840 bool Extension::IsDisallowedExperimentalPermission( 2847 bool Extension::IsDisallowedExperimentalPermission(
2841 ExtensionAPIPermission::ID permission) const { 2848 ExtensionAPIPermission::ID permission) const {
2842 return permission == ExtensionAPIPermission::kExperimental && 2849 return permission == ExtensionAPIPermission::kExperimental &&
2843 !CommandLine::ForCurrentProcess()->HasSwitch( 2850 !CommandLine::ForCurrentProcess()->HasSwitch(
2844 switches::kEnableExperimentalExtensionApis); 2851 switches::kEnableExperimentalExtensionApis);
2845 } 2852 }
2846 2853
2847 bool Extension::CanExecuteScriptEverywhere() const { 2854 bool Extension::CanExecuteScriptEverywhere() const {
2848 if (location() == Extension::COMPONENT 2855 if (location() == Extension::COMPONENT
2849 #ifndef NDEBUG 2856 #ifndef NDEBUG
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 already_disabled(false), 2991 already_disabled(false),
2985 extension(extension) {} 2992 extension(extension) {}
2986 2993
2987 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 2994 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
2988 const Extension* extension, 2995 const Extension* extension,
2989 const ExtensionPermissionSet* permissions, 2996 const ExtensionPermissionSet* permissions,
2990 Reason reason) 2997 Reason reason)
2991 : reason(reason), 2998 : reason(reason),
2992 extension(extension), 2999 extension(extension),
2993 permissions(permissions) {} 3000 permissions(permissions) {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698