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 #ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ |
6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 void CancelGeolocationPermissionRequest( | 37 void CancelGeolocationPermissionRequest( |
38 int render_process_id, int render_view_id, int bridge_id, | 38 int render_process_id, int render_view_id, int bridge_id, |
39 const GURL& requesting_frame); | 39 const GURL& requesting_frame); |
40 | 40 |
41 // Notifies whether or not the corresponding bridge is allowed to use | 41 // Notifies whether or not the corresponding bridge is allowed to use |
42 // geolocation via ViewMsg_Geolocation_PermissionSet. | 42 // geolocation via ViewMsg_Geolocation_PermissionSet. |
43 void NotifyPermissionSet( | 43 void NotifyPermissionSet( |
44 int render_process_id, int render_view_id, int bridge_id, | 44 int render_process_id, int render_view_id, int bridge_id, |
45 const GURL& requesting_frame, bool allowed); | 45 const GURL& requesting_frame, bool allowed); |
46 | 46 |
47 // Called when a geolocation object wants to start receiving location updates. | |
48 // This also applies global policy around which location providers may be | |
49 // enabled at a given time (e.g. prior to the user agreeing to any geolocation | |
50 // permission requests). | |
51 void StartUpdatingRequested( | |
52 int render_process_id, int render_view_id, int bridge_id, | |
53 const GURL& requesting_frame); | |
54 | |
55 // Called when a geolocation object has stopped. Because we are | |
56 // short-circuiting permission request (see StartUpdatingRequested above), we | |
57 // cancel any pending permission in here, since WebKit doesn't know about the | |
58 // pending permission request and will never call | |
59 // CancelGeolocationPermissionRequest(). | |
60 void StopUpdatingRequested( | |
61 int render_process_id, int render_view_id, int bridge_id); | |
62 | |
63 private: | 47 private: |
64 friend class base::RefCountedThreadSafe<GeolocationPermissionContext>; | 48 friend class base::RefCountedThreadSafe<GeolocationPermissionContext>; |
65 virtual ~GeolocationPermissionContext(); | 49 virtual ~GeolocationPermissionContext(); |
66 | 50 |
67 // Calls GeolocationArbitrator::OnPermissionGranted. | 51 // Calls GeolocationArbitrator::OnPermissionGranted. |
68 void NotifyArbitratorPermissionGranted(const GURL& requesting_frame); | 52 void NotifyArbitratorPermissionGranted(const GURL& requesting_frame); |
69 | 53 |
70 // Removes any pending InfoBar request. | 54 // Removes any pending InfoBar request. |
71 void CancelPendingInfoBarRequest( | 55 void CancelPendingInfoBarRequest( |
72 int render_process_id, int render_view_id, int bridge_id); | 56 int render_process_id, int render_view_id, int bridge_id); |
73 | 57 |
74 // This should only be accessed from the UI thread. | 58 // This should only be accessed from the UI thread. |
75 Profile* const profile_; | 59 Profile* const profile_; |
76 | 60 |
77 scoped_ptr<GeolocationInfoBarQueueController> | 61 scoped_ptr<GeolocationInfoBarQueueController> |
78 geolocation_infobar_queue_controller_; | 62 geolocation_infobar_queue_controller_; |
79 | 63 |
80 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContext); | 64 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContext); |
81 }; | 65 }; |
82 | 66 |
83 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ | 67 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ |
OLD | NEW |