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

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

Issue 8515027: Define the public version of the browser side RenderProcessHost interface. This interface is not ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/browser/extensions/extension_permissions_api.h" 5 #include "chrome/browser/extensions/extension_permissions_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/extension_event_router.h" 9 #include "chrome/browser/extensions/extension_event_router.h"
10 #include "chrome/browser/extensions/extension_prefs.h" 10 #include "chrome/browser/extensions/extension_prefs.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 // Notify other APIs or interested parties. 212 // Notify other APIs or interested parties.
213 UpdatedExtensionPermissionsInfo info = UpdatedExtensionPermissionsInfo( 213 UpdatedExtensionPermissionsInfo info = UpdatedExtensionPermissionsInfo(
214 extension, changed, reason); 214 extension, changed, reason);
215 content::NotificationService::current()->Notify( 215 content::NotificationService::current()->Notify(
216 chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED, 216 chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
217 content::Source<Profile>(extension_service_->profile()), 217 content::Source<Profile>(extension_service_->profile()),
218 content::Details<UpdatedExtensionPermissionsInfo>(&info)); 218 content::Details<UpdatedExtensionPermissionsInfo>(&info));
219 219
220 // Send the new permissions to the renderers. 220 // Send the new permissions to the renderers.
221 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); 221 for (content::RenderProcessHost::iterator i(
222 content::RenderProcessHost::AllHostsIterator());
222 !i.IsAtEnd(); i.Advance()) { 223 !i.IsAtEnd(); i.Advance()) {
223 RenderProcessHost* host = i.GetCurrentValue(); 224 content::RenderProcessHost* host = i.GetCurrentValue();
224 Profile* profile = Profile::FromBrowserContext(host->browser_context()); 225 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
225 if (extension_service_->profile()->IsSameProfile(profile)) 226 if (extension_service_->profile()->IsSameProfile(profile))
226 host->Send(new ExtensionMsg_UpdatePermissions( 227 host->Send(new ExtensionMsg_UpdatePermissions(
227 static_cast<int>(reason), 228 static_cast<int>(reason),
228 extension->id(), 229 extension->id(),
229 changed->apis(), 230 changed->apis(),
230 changed->explicit_hosts(), 231 changed->explicit_hosts(),
231 changed->scriptable_hosts())); 232 changed->scriptable_hosts()));
232 } 233 }
233 234
234 // Trigger the onAdded and onRemoved events in the extension. 235 // Trigger the onAdded and onRemoved events in the extension.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 } 409 }
409 410
410 void RequestPermissionsFunction::InstallUIAbort(bool user_initiated) { 411 void RequestPermissionsFunction::InstallUIAbort(bool user_initiated) {
411 install_ui_.reset(); 412 install_ui_.reset();
412 result_.reset(Value::CreateBooleanValue(false)); 413 result_.reset(Value::CreateBooleanValue(false));
413 requested_permissions_ = NULL; 414 requested_permissions_ = NULL;
414 415
415 SendResponse(true); 416 SendResponse(true);
416 Release(); 417 Release();
417 } 418 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_permissions_api.h ('k') | chrome/browser/extensions/extension_processes_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698