OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 extension->id(), render_process_id)) { | 617 extension->id(), render_process_id)) { |
618 NotifyPermissionSet(render_process_id, render_view_id, bridge_id, | 618 NotifyPermissionSet(render_process_id, render_view_id, bridge_id, |
619 requesting_frame, callback, true); | 619 requesting_frame, callback, true); |
620 return; | 620 return; |
621 } | 621 } |
622 } | 622 } |
623 } | 623 } |
624 | 624 |
625 WebContents* web_contents = | 625 WebContents* web_contents = |
626 tab_util::GetWebContentsByID(render_process_id, render_view_id); | 626 tab_util::GetWebContentsByID(render_process_id, render_view_id); |
627 if (!web_contents || web_contents->GetViewType() != | 627 if (chrome::GetViewType(web_contents) != chrome::VIEW_TYPE_TAB_CONTENTS) { |
628 chrome::VIEW_TYPE_TAB_CONTENTS) { | |
629 // The tab may have gone away, or the request may not be from a tab at all. | 628 // The tab may have gone away, or the request may not be from a tab at all. |
630 // TODO(mpcomplete): the request could be from a background page or | 629 // TODO(mpcomplete): the request could be from a background page or |
631 // extension popup (tab_contents will have a different ViewType). But why do | 630 // extension popup (tab_contents will have a different ViewType). But why do |
632 // we care? Shouldn't we still put an infobar up in the current tab? | 631 // we care? Shouldn't we still put an infobar up in the current tab? |
633 LOG(WARNING) << "Attempt to use geolocation tabless renderer: " | 632 LOG(WARNING) << "Attempt to use geolocation tabless renderer: " |
634 << render_process_id << "," << render_view_id << "," | 633 << render_process_id << "," << render_view_id << "," |
635 << bridge_id << " (can't prompt user without a visible tab)"; | 634 << bridge_id << " (can't prompt user without a visible tab)"; |
636 NotifyPermissionSet(render_process_id, render_view_id, bridge_id, | 635 NotifyPermissionSet(render_process_id, render_view_id, bridge_id, |
637 requesting_frame, callback, false); | 636 requesting_frame, callback, false); |
638 return; | 637 return; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 BrowserThread::UI, FROM_HERE, | 703 BrowserThread::UI, FROM_HERE, |
705 base::Bind( | 704 base::Bind( |
706 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, | 705 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, |
707 this, render_process_id, render_view_id, bridge_id)); | 706 this, render_process_id, render_view_id, bridge_id)); |
708 return; | 707 return; |
709 } | 708 } |
710 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 709 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
711 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, | 710 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, |
712 render_view_id, bridge_id); | 711 render_view_id, bridge_id); |
713 } | 712 } |
OLD | NEW |