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

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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
222 !i.IsAtEnd(); i.Advance()) { 222 !i.IsAtEnd(); i.Advance()) {
223 RenderProcessHost* host = i.GetCurrentValue(); 223 RenderProcessHost* host = i.GetCurrentValue();
224 Profile* profile = Profile::FromBrowserContext(host->browser_context()); 224 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
225 if (extension_service_->profile()->IsSameProfile(profile)) 225 if (extension_service_->profile()->IsSameProfile(profile))
226 host->Send(new ExtensionMsg_UpdatePermissions( 226 host->Send(new ExtensionMsg_UpdatePermissions(
227 static_cast<int>(reason), 227 static_cast<int>(reason),
228 extension->id(), 228 extension->id(),
229 changed->apis(), 229 changed->apis(),
230 changed->explicit_hosts(), 230 changed->explicit_hosts(),
231 changed->scriptable_hosts())); 231 changed->scriptable_hosts()));
232 } 232 }
233 233
234 // Trigger the onAdded and onRemoved events in the extension. 234 // Trigger the onAdded and onRemoved events in the extension.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 } 408 }
409 409
410 void RequestPermissionsFunction::InstallUIAbort(bool user_initiated) { 410 void RequestPermissionsFunction::InstallUIAbort(bool user_initiated) {
411 install_ui_.reset(); 411 install_ui_.reset();
412 result_.reset(Value::CreateBooleanValue(false)); 412 result_.reset(Value::CreateBooleanValue(false));
413 requested_permissions_ = NULL; 413 requested_permissions_ = NULL;
414 414
415 SendResponse(true); 415 SendResponse(true);
416 Release(); 416 Release();
417 } 417 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698