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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
544 BrowserThread::PostTask( | 544 BrowserThread::PostTask( |
545 BrowserThread::UI, FROM_HERE, | 545 BrowserThread::UI, FROM_HERE, |
546 base::Bind( | 546 base::Bind( |
547 &ChromeGeolocationPermissionContext::RequestGeolocationPermission, | 547 &ChromeGeolocationPermissionContext::RequestGeolocationPermission, |
548 this, render_process_id, render_view_id, bridge_id, | 548 this, render_process_id, render_view_id, bridge_id, |
549 requesting_frame, callback)); | 549 requesting_frame, callback)); |
550 return; | 550 return; |
551 } | 551 } |
552 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 552 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
553 | 553 |
554 ExtensionService* extensions = profile_->GetExtensionService(); | 554 ExtensionService* ext_service = profile_->GetExtensionService(); |
555 if (extensions) { | 555 if (ext_service) { |
556 const Extension* ext = extensions->GetExtensionByURL(requesting_frame); | 556 const Extension* ext = |
557 if (!ext) | 557 ext_service->extensions()->GetByURL(ExtensionURLInfo(requesting_frame)); |
abarth-chromium
2011/12/07 23:51:44
This one probably needs a SecurityOrigin too. San
Yoyo Zhou
2011/12/08 01:04:51
Looks like this one is changing a security origin
| |
558 ext = extensions->GetExtensionByWebExtent(requesting_frame); | |
559 if (ext && ext->HasAPIPermission(ExtensionAPIPermission::kGeolocation)) { | 558 if (ext && ext->HasAPIPermission(ExtensionAPIPermission::kGeolocation)) { |
560 // Make sure the extension is in the calling process. | 559 // Make sure the extension is in the calling process. |
561 if (extensions->process_map()->Contains(ext->id(), render_process_id)) { | 560 if (ext_service->process_map()->Contains(ext->id(), render_process_id)) { |
562 NotifyPermissionSet(render_process_id, render_view_id, bridge_id, | 561 NotifyPermissionSet(render_process_id, render_view_id, bridge_id, |
563 requesting_frame, callback, true); | 562 requesting_frame, callback, true); |
564 return; | 563 return; |
565 } | 564 } |
566 } | 565 } |
567 } | 566 } |
568 | 567 |
569 TabContents* tab_contents = | 568 TabContents* tab_contents = |
570 tab_util::GetTabContentsByID(render_process_id, render_view_id); | 569 tab_util::GetTabContentsByID(render_process_id, render_view_id); |
571 if (!tab_contents || | 570 if (!tab_contents || |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
662 BrowserThread::UI, FROM_HERE, | 661 BrowserThread::UI, FROM_HERE, |
663 base::Bind( | 662 base::Bind( |
664 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, | 663 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, |
665 this, render_process_id, render_view_id, bridge_id)); | 664 this, render_process_id, render_view_id, bridge_id)); |
666 return; | 665 return; |
667 } | 666 } |
668 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 667 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
669 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, | 668 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, |
670 render_view_id, bridge_id); | 669 render_view_id, bridge_id); |
671 } | 670 } |
OLD | NEW |