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

Unified Diff: chrome/browser/extensions/active_tab_permission_granter.cc

Issue 309533007: Refactor PermissionsData pt1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/active_tab_permission_granter.cc
diff --git a/chrome/browser/extensions/active_tab_permission_granter.cc b/chrome/browser/extensions/active_tab_permission_granter.cc
index d508f557b36f899f8a52042c2adc136dd8a02e13..840aa71b054948bc5a41e9d3941e9954c89988bc 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.cc
+++ b/chrome/browser/extensions/active_tab_permission_granter.cc
@@ -49,10 +49,10 @@ void ActiveTabPermissionGranter::GrantIfRequested(const Extension* extension) {
// We don't take tab id into account, because we want to know if the extension
// should require active tab in general (not for the current tab).
bool requires_action_for_script_execution =
- PermissionsData::RequiresActionForScriptExecution(
- extension,
- -1, // No tab id.
- GURL::EmptyGURL());
+ PermissionsData::ForExtension(extension)
+ ->RequiresActionForScriptExecution(extension,
+ -1, // No tab id.
+ GURL());
if (extension->HasAPIPermission(APIPermission::kActiveTab) ||
requires_action_for_script_execution) {
@@ -73,9 +73,8 @@ void ActiveTabPermissionGranter::GrantIfRequested(const Extension* extension) {
scoped_refptr<const PermissionSet> new_permissions =
new PermissionSet(new_apis, ManifestPermissionSet(),
new_hosts, URLPatternSet());
- PermissionsData::UpdateTabSpecificPermissions(extension,
- tab_id_,
- new_permissions);
+ PermissionsData::ForExtension(extension)
not at google - send to devlin 2014/06/02 23:20:06 and here
Devlin 2014/06/03 15:28:21 Done.
+ ->UpdateTabSpecificPermissions(tab_id_, new_permissions);
const content::NavigationEntry* navigation_entry =
web_contents()->GetController().GetVisibleEntry();
if (navigation_entry) {
@@ -125,7 +124,8 @@ void ActiveTabPermissionGranter::ClearActiveExtensionsAndNotify() {
for (ExtensionSet::const_iterator it = granted_extensions_.begin();
it != granted_extensions_.end(); ++it) {
- PermissionsData::ClearTabSpecificPermissions(it->get(), tab_id_);
+ PermissionsData::ForExtension(it->get())
+ ->ClearTabSpecificPermissions(tab_id_);
extension_ids.push_back((*it)->id());
}

Powered by Google App Engine
This is Rietveld 408576698