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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 9222013: Prevent unnecessary prompts when unpacked extensions use chrome.permissions.request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reword comment Created 8 years, 11 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) 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/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 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after
2653 // TODO(skerner): Consider showing the reason |permission_str| is not 2653 // TODO(skerner): Consider showing the reason |permission_str| is not
2654 // a valid URL pattern if it is almost valid. For example, if it has 2654 // a valid URL pattern if it is almost valid. For example, if it has
2655 // a valid scheme, and failed to parse because it has a port, show an 2655 // a valid scheme, and failed to parse because it has a port, show an
2656 // error. 2656 // error.
2657 } 2657 }
2658 } 2658 }
2659 return true; 2659 return true;
2660 } 2660 }
2661 2661
2662 bool Extension::CanSilentlyIncreasePermissions() const { 2662 bool Extension::CanSilentlyIncreasePermissions() const {
2663 return location() != INTERNAL; 2663 return location() != INTERNAL && location() != LOAD;
2664 } 2664 }
2665 2665
2666 bool Extension::CanSpecifyHostPermission(const URLPattern& pattern, 2666 bool Extension::CanSpecifyHostPermission(const URLPattern& pattern,
2667 const ExtensionAPIPermissionSet& permissions) const { 2667 const ExtensionAPIPermissionSet& permissions) const {
2668 if (!pattern.match_all_urls() && 2668 if (!pattern.match_all_urls() &&
2669 pattern.MatchesScheme(chrome::kChromeUIScheme)) { 2669 pattern.MatchesScheme(chrome::kChromeUIScheme)) {
2670 // Regular extensions are only allowed access to chrome://favicon. 2670 // Regular extensions are only allowed access to chrome://favicon.
2671 if (pattern.host() == chrome::kChromeUIFaviconHost) 2671 if (pattern.host() == chrome::kChromeUIFaviconHost)
2672 return true; 2672 return true;
2673 2673
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
3042 already_disabled(false), 3042 already_disabled(false),
3043 extension(extension) {} 3043 extension(extension) {}
3044 3044
3045 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 3045 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
3046 const Extension* extension, 3046 const Extension* extension,
3047 const ExtensionPermissionSet* permissions, 3047 const ExtensionPermissionSet* permissions,
3048 Reason reason) 3048 Reason reason)
3049 : reason(reason), 3049 : reason(reason),
3050 extension(extension), 3050 extension(extension),
3051 permissions(permissions) {} 3051 permissions(permissions) {}
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/test/data/extensions/api_test/permissions/optional/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698