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

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

Issue 315573003: Remove PermissionsData::ForExtension() completely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/browser/extensions/permissions_updater.h" 5 #include "chrome/browser/extensions/permissions_updater.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return; 77 return;
78 78
79 ExtensionPrefs::Get(profile_)->AddGrantedPermissions( 79 ExtensionPrefs::Get(profile_)->AddGrantedPermissions(
80 extension->id(), extension->GetActivePermissions().get()); 80 extension->id(), extension->GetActivePermissions().get());
81 } 81 }
82 82
83 void PermissionsUpdater::UpdateActivePermissions( 83 void PermissionsUpdater::UpdateActivePermissions(
84 const Extension* extension, const PermissionSet* permissions) { 84 const Extension* extension, const PermissionSet* permissions) {
85 ExtensionPrefs::Get(profile_)->SetActivePermissions( 85 ExtensionPrefs::Get(profile_)->SetActivePermissions(
86 extension->id(), permissions); 86 extension->id(), permissions);
87 PermissionsData::ForExtension(extension)->SetActivePermissions(permissions); 87 extension->permissions_data()->SetActivePermissions(permissions);
88 } 88 }
89 89
90 void PermissionsUpdater::DispatchEvent( 90 void PermissionsUpdater::DispatchEvent(
91 const std::string& extension_id, 91 const std::string& extension_id,
92 const char* event_name, 92 const char* event_name,
93 const PermissionSet* changed_permissions) { 93 const PermissionSet* changed_permissions) {
94 if (!profile_ || !EventRouter::Get(profile_)) 94 if (!profile_ || !EventRouter::Get(profile_))
95 return; 95 return;
96 96
97 scoped_ptr<base::ListValue> value(new base::ListValue()); 97 scoped_ptr<base::ListValue> value(new base::ListValue());
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 info.scriptable_hosts = changed->scriptable_hosts(); 146 info.scriptable_hosts = changed->scriptable_hosts();
147 host->Send(new ExtensionMsg_UpdatePermissions(info)); 147 host->Send(new ExtensionMsg_UpdatePermissions(info));
148 } 148 }
149 } 149 }
150 150
151 // Trigger the onAdded and onRemoved events in the extension. 151 // Trigger the onAdded and onRemoved events in the extension.
152 DispatchEvent(extension->id(), event_name, changed); 152 DispatchEvent(extension->id(), event_name, changed);
153 } 153 }
154 154
155 } // namespace extensions 155 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tab_util.cc ('k') | chrome/browser/media_galleries/media_galleries_dialog_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698