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

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

Issue 18399007: Don't count host permission changes for v2 apps as a permission increase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 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
« no previous file with comments | « no previous file | chrome/common/extensions/permissions/permission_set.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 2157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2168 // hasn't been initialized yet. 2168 // hasn't been initialized yet.
2169 scoped_refptr<PermissionSet> granted_permissions = 2169 scoped_refptr<PermissionSet> granted_permissions =
2170 extension_prefs_->GetGrantedPermissions(extension->id()); 2170 extension_prefs_->GetGrantedPermissions(extension->id());
2171 CHECK(granted_permissions.get()); 2171 CHECK(granted_permissions.get());
2172 2172
2173 // Here, we check if an extension's privileges have increased in a manner 2173 // Here, we check if an extension's privileges have increased in a manner
2174 // that requires the user's approval. This could occur because the browser 2174 // that requires the user's approval. This could occur because the browser
2175 // upgraded and recognized additional privileges, or an extension upgrades 2175 // upgraded and recognized additional privileges, or an extension upgrades
2176 // to a version that requires additional privileges. 2176 // to a version that requires additional privileges.
2177 is_privilege_increase = granted_permissions->HasLessPrivilegesThan( 2177 is_privilege_increase = granted_permissions->HasLessPrivilegesThan(
2178 extension->GetActivePermissions().get()); 2178 extension->GetActivePermissions().get(), extension->GetType());
2179 } 2179 }
2180 2180
2181 if (is_extension_upgrade) { 2181 if (is_extension_upgrade) {
2182 // If the extension was already disabled, suppress any alerts for becoming 2182 // If the extension was already disabled, suppress any alerts for becoming
2183 // disabled on permissions increase. 2183 // disabled on permissions increase.
2184 bool previously_disabled = 2184 bool previously_disabled =
2185 extension_prefs_->IsExtensionDisabled(extension->id()); 2185 extension_prefs_->IsExtensionDisabled(extension->id());
2186 // Legacy disabled extensions do not have a disable reason. Infer that if 2186 // Legacy disabled extensions do not have a disable reason. Infer that if
2187 // there was no permission increase, it was likely disabled by the user. 2187 // there was no permission increase, it was likely disabled by the user.
2188 if (previously_disabled && disable_reasons == Extension::DISABLE_NONE && 2188 if (previously_disabled && disable_reasons == Extension::DISABLE_NONE &&
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
3084 } 3084 }
3085 3085
3086 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { 3086 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) {
3087 update_observers_.AddObserver(observer); 3087 update_observers_.AddObserver(observer);
3088 } 3088 }
3089 3089
3090 void ExtensionService::RemoveUpdateObserver( 3090 void ExtensionService::RemoveUpdateObserver(
3091 extensions::UpdateObserver* observer) { 3091 extensions::UpdateObserver* observer) {
3092 update_observers_.RemoveObserver(observer); 3092 update_observers_.RemoveObserver(observer);
3093 } 3093 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/permissions/permission_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698