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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 profile_)) { | 79 profile_)) { |
80 // Make sure the extension is in the calling process. | 80 // Make sure the extension is in the calling process. |
81 if (extension_service->process_map()->Contains(extension->id(), | 81 if (extension_service->process_map()->Contains(extension->id(), |
82 id.render_process_id())) { | 82 id.render_process_id())) { |
83 NotifyPermissionSet(id, requesting_frame, callback, true); | 83 NotifyPermissionSet(id, requesting_frame, callback, true); |
84 return; | 84 return; |
85 } | 85 } |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 if (chrome::GetViewType(web_contents) != chrome::VIEW_TYPE_TAB_CONTENTS) { | 89 if (chrome::GetViewType(web_contents) != extensions::VIEW_TYPE_TAB_CONTENTS) { |
90 // The tab may have gone away, or the request may not be from a tab at all. | 90 // The tab may have gone away, or the request may not be from a tab at all. |
91 // TODO(mpcomplete): the request could be from a background page or | 91 // TODO(mpcomplete): the request could be from a background page or |
92 // extension popup (web_contents will have a different ViewType). But why do | 92 // extension popup (web_contents will have a different ViewType). But why do |
93 // we care? Shouldn't we still put an infobar up in the current tab? | 93 // we care? Shouldn't we still put an infobar up in the current tab? |
94 LOG(WARNING) << "Attempt to use geolocation tabless renderer: " | 94 LOG(WARNING) << "Attempt to use geolocation tabless renderer: " |
95 << id.ToString() | 95 << id.ToString() |
96 << " (can't prompt user without a visible tab)"; | 96 << " (can't prompt user without a visible tab)"; |
97 NotifyPermissionSet(id, requesting_frame, callback, false); | 97 NotifyPermissionSet(id, requesting_frame, callback, false); |
98 return; | 98 return; |
99 } | 99 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 base::Bind( | 203 base::Bind( |
204 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, | 204 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, |
205 this, id)); | 205 this, id)); |
206 return; | 206 return; |
207 } | 207 } |
208 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 208 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
209 if (shutting_down_) | 209 if (shutting_down_) |
210 return; | 210 return; |
211 QueueController()->CancelInfoBarRequest(id); | 211 QueueController()->CancelInfoBarRequest(id); |
212 } | 212 } |
OLD | NEW |