| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |