Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: chrome/browser/geolocation/geolocation_permission_context.cc

Issue 6127001: Geolocation code cleanup following switch to client-based Geolocation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/geolocation/geolocation_permission_context.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698