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

Side by Side Diff: chrome/browser/geolocation/chrome_geolocation_permission_context.cc

Issue 7003098: Start refractoring extension permissions into ExtensionPermissionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: See if rebasing fixes the tests... Created 9 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
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.cc ('k') | chrome/browser/profiles/profile.cc » ('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) 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/geolocation/chrome_geolocation_permission_context.h" 5 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
6 6
7 #include <functional> 7 #include <functional>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 render_process_id, render_view_id, bridge_id, requesting_frame)); 510 render_process_id, render_view_id, bridge_id, requesting_frame));
511 return; 511 return;
512 } 512 }
513 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 513 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
514 514
515 ExtensionService* extensions = profile_->GetExtensionService(); 515 ExtensionService* extensions = profile_->GetExtensionService();
516 if (extensions) { 516 if (extensions) {
517 const Extension* ext = extensions->GetExtensionByURL(requesting_frame); 517 const Extension* ext = extensions->GetExtensionByURL(requesting_frame);
518 if (!ext) 518 if (!ext)
519 ext = extensions->GetExtensionByWebExtent(requesting_frame); 519 ext = extensions->GetExtensionByWebExtent(requesting_frame);
520 if (ext && ext->HasApiPermission(Extension::kGeolocationPermission)) { 520 if (ext && ext->HasAPIPermission(ExtensionAPIPermission::kGeolocation)) {
521 ExtensionProcessManager* epm = profile_->GetExtensionProcessManager(); 521 ExtensionProcessManager* epm = profile_->GetExtensionProcessManager();
522 RenderProcessHost* process = epm->GetExtensionProcess(requesting_frame); 522 RenderProcessHost* process = epm->GetExtensionProcess(requesting_frame);
523 if (process && process->id() == render_process_id) { 523 if (process && process->id() == render_process_id) {
524 NotifyPermissionSet(render_process_id, render_view_id, bridge_id, 524 NotifyPermissionSet(render_process_id, render_view_id, bridge_id,
525 requesting_frame, true); 525 requesting_frame, true);
526 return; 526 return;
527 } 527 }
528 } 528 }
529 } 529 }
530 530
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { 614 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
615 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod( 615 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(
616 this, &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, 616 this, &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest,
617 render_process_id, render_view_id, bridge_id)); 617 render_process_id, render_view_id, bridge_id));
618 return; 618 return;
619 } 619 }
620 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 620 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
621 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, 621 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id,
622 render_view_id, bridge_id); 622 render_view_id, bridge_id);
623 } 623 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.cc ('k') | chrome/browser/profiles/profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698