| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 embedder); | 425 embedder); |
| 426 } | 426 } |
| 427 } | 427 } |
| 428 | 428 |
| 429 void GeolocationPermissionContext::CancelGeolocationPermissionRequest( | 429 void GeolocationPermissionContext::CancelGeolocationPermissionRequest( |
| 430 int render_process_id, int render_view_id, int bridge_id, | 430 int render_process_id, int render_view_id, int bridge_id, |
| 431 const GURL& requesting_frame) { | 431 const GURL& requesting_frame) { |
| 432 CancelPendingInfoBarRequest(render_process_id, render_view_id, bridge_id); | 432 CancelPendingInfoBarRequest(render_process_id, render_view_id, bridge_id); |
| 433 } | 433 } |
| 434 | 434 |
| 435 void GeolocationPermissionContext::StartUpdatingRequested( | |
| 436 int render_process_id, int render_view_id, int bridge_id, | |
| 437 const GURL& requesting_frame) { | |
| 438 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
| 439 // Note we cannot store the arbitrator as a member as it is not thread safe. | |
| 440 GeolocationProvider* provider = GeolocationProvider::GetInstance(); | |
| 441 | |
| 442 // Client-based Geolocation uses a preemptive permission model, so permission | |
| 443 // ought to have been requested and granted before the controller requests | |
| 444 // the client to start updating. | |
| 445 DCHECK(provider->HasPermissionBeenGranted()); | |
| 446 } | |
| 447 | |
| 448 void GeolocationPermissionContext::StopUpdatingRequested( | |
| 449 int render_process_id, int render_view_id, int bridge_id) { | |
| 450 } | |
| 451 | |
| 452 void GeolocationPermissionContext::NotifyPermissionSet( | 435 void GeolocationPermissionContext::NotifyPermissionSet( |
| 453 int render_process_id, int render_view_id, int bridge_id, | 436 int render_process_id, int render_view_id, int bridge_id, |
| 454 const GURL& requesting_frame, bool allowed) { | 437 const GURL& requesting_frame, bool allowed) { |
| 455 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 438 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 456 | 439 |
| 457 TabContents* tab_contents = | 440 TabContents* tab_contents = |
| 458 tab_util::GetTabContentsByID(render_process_id, render_view_id); | 441 tab_util::GetTabContentsByID(render_process_id, render_view_id); |
| 459 | 442 |
| 460 // TabContents may have gone away (or not exists for extension). | 443 // TabContents may have gone away (or not exists for extension). |
| 461 if (tab_contents) { | 444 if (tab_contents) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 492 BrowserThread::UI, FROM_HERE, | 475 BrowserThread::UI, FROM_HERE, |
| 493 NewRunnableMethod(this, | 476 NewRunnableMethod(this, |
| 494 &GeolocationPermissionContext::CancelPendingInfoBarRequest, | 477 &GeolocationPermissionContext::CancelPendingInfoBarRequest, |
| 495 render_process_id, render_view_id, bridge_id)); | 478 render_process_id, render_view_id, bridge_id)); |
| 496 return; | 479 return; |
| 497 } | 480 } |
| 498 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 481 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 499 geolocation_infobar_queue_controller_->CancelInfoBarRequest( | 482 geolocation_infobar_queue_controller_->CancelInfoBarRequest( |
| 500 render_process_id, render_view_id, bridge_id); | 483 render_process_id, render_view_id, bridge_id); |
| 501 } | 484 } |
| OLD | NEW |