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

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

Issue 7003098: Start refractoring extension permissions into ExtensionPermissionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a bad merge 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
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 "content/browser/geolocation/geolocation_permission_context.h" 5 #include "content/browser/geolocation/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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 render_process_id, render_view_id, bridge_id, requesting_frame)); 512 render_process_id, render_view_id, bridge_id, requesting_frame));
513 return; 513 return;
514 } 514 }
515 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 515 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
516 516
517 ExtensionService* extensions = profile_->GetExtensionService(); 517 ExtensionService* extensions = profile_->GetExtensionService();
518 if (extensions) { 518 if (extensions) {
519 const Extension* ext = extensions->GetExtensionByURL(requesting_frame); 519 const Extension* ext = extensions->GetExtensionByURL(requesting_frame);
520 if (!ext) 520 if (!ext)
521 ext = extensions->GetExtensionByWebExtent(requesting_frame); 521 ext = extensions->GetExtensionByWebExtent(requesting_frame);
522 if (ext && ext->HasApiPermission(Extension::kGeolocationPermission)) { 522 if (ext && ext->HasApiPermission(ExtensionAPIPermission::Geolocation())) {
523 ExtensionProcessManager* epm = profile_->GetExtensionProcessManager(); 523 ExtensionProcessManager* epm = profile_->GetExtensionProcessManager();
524 RenderProcessHost* process = epm->GetExtensionProcess(requesting_frame); 524 RenderProcessHost* process = epm->GetExtensionProcess(requesting_frame);
525 if (process && process->id() == render_process_id) { 525 if (process && process->id() == render_process_id) {
526 NotifyPermissionSet(render_process_id, render_view_id, bridge_id, 526 NotifyPermissionSet(render_process_id, render_view_id, bridge_id,
527 requesting_frame, true); 527 requesting_frame, true);
528 return; 528 return;
529 } 529 }
530 } 530 }
531 } 531 }
532 532
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { 618 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
619 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod( 619 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(
620 this, &GeolocationPermissionContext::CancelPendingInfoBarRequest, 620 this, &GeolocationPermissionContext::CancelPendingInfoBarRequest,
621 render_process_id, render_view_id, bridge_id)); 621 render_process_id, render_view_id, bridge_id));
622 return; 622 return;
623 } 623 }
624 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 624 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
625 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, 625 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id,
626 render_view_id, bridge_id); 626 render_view_id, bridge_id);
627 } 627 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698