| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 case CONTENT_SETTING_BLOCK: | 235 case CONTENT_SETTING_BLOCK: |
| 236 PermissionDecided(id, requesting_frame, embedder, callback, false); | 236 PermissionDecided(id, requesting_frame, embedder, callback, false); |
| 237 break; | 237 break; |
| 238 case CONTENT_SETTING_ALLOW: | 238 case CONTENT_SETTING_ALLOW: |
| 239 PermissionDecided(id, requesting_frame, embedder, callback, true); | 239 PermissionDecided(id, requesting_frame, embedder, callback, true); |
| 240 break; | 240 break; |
| 241 default: | 241 default: |
| 242 if (PermissionBubbleManager::Enabled()) { | 242 if (PermissionBubbleManager::Enabled()) { |
| 243 PermissionBubbleManager* mgr = | 243 PermissionBubbleManager* mgr = |
| 244 PermissionBubbleManager::FromWebContents(web_contents); | 244 PermissionBubbleManager::FromWebContents(web_contents); |
| 245 mgr->AddRequest(new GeolocationPermissionRequest( | 245 if (mgr) { |
| 246 this, id, requesting_frame, user_gesture, callback, | 246 mgr->AddRequest(new GeolocationPermissionRequest( |
| 247 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages))); | 247 this, id, requesting_frame, user_gesture, callback, |
| 248 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages))); |
| 249 } |
| 248 } else { | 250 } else { |
| 249 // setting == ask. Prompt the user. | 251 // setting == ask. Prompt the user. |
| 250 QueueController()->CreateInfoBarRequest( | 252 QueueController()->CreateInfoBarRequest( |
| 251 id, requesting_frame, embedder, accept_button_label, | 253 id, requesting_frame, embedder, accept_button_label, |
| 252 base::Bind( | 254 base::Bind( |
| 253 &ChromeGeolocationPermissionContext::NotifyPermissionSet, | 255 &ChromeGeolocationPermissionContext::NotifyPermissionSet, |
| 254 base::Unretained(this), id, requesting_frame, callback)); | 256 base::Unretained(this), id, requesting_frame, callback)); |
| 255 } | 257 } |
| 256 } | 258 } |
| 257 } | 259 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 322 |
| 321 void ChromeGeolocationPermissionContext::CancelPendingInfobarRequest( | 323 void ChromeGeolocationPermissionContext::CancelPendingInfobarRequest( |
| 322 const PermissionRequestID& id) { | 324 const PermissionRequestID& id) { |
| 323 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 325 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 324 if (shutting_down_) | 326 if (shutting_down_) |
| 325 return; | 327 return; |
| 326 | 328 |
| 327 // TODO(gbillock): handle permission bubble cancellation. | 329 // TODO(gbillock): handle permission bubble cancellation. |
| 328 QueueController()->CancelInfoBarRequest(id); | 330 QueueController()->CancelInfoBarRequest(id); |
| 329 } | 331 } |
| OLD | NEW |