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 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ |
6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/geolocation.h" |
11 | 12 |
12 class GURL; | 13 class GURL; |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 // GeolocationPermissionContext must be implemented by the embedder, to provide | 17 // GeolocationPermissionContext must be implemented by the embedder, to provide |
17 // the policy and logic for the Geolocation permissions flow. | 18 // the policy and logic for the Geolocation permissions flow. |
18 // This includes both prompting the user and persisting results, as required. | 19 // This includes both prompting the user and persisting results, as required. |
19 class CONTENT_EXPORT GeolocationPermissionContext | 20 class CONTENT_EXPORT GeolocationPermissionContext |
20 : public base::RefCountedThreadSafe<GeolocationPermissionContext> { | 21 : public base::RefCountedThreadSafe<GeolocationPermissionContext> { |
21 public: | 22 public: |
22 // The renderer is requesting permission to use Geolocation. | 23 // The renderer is requesting permission to use Geolocation. |
23 // When the answer to a permission request has been determined, |callback| | 24 // When the answer to a permission request has been determined, |callback| |
24 // should be called with the result. | 25 // should be called with the result. |
25 virtual void RequestGeolocationPermission( | 26 virtual void RequestGeolocationPermission( |
26 int render_process_id, | 27 const GeolocationPermissionRequestID& id, |
27 int render_view_id, | |
28 int bridge_id, | |
29 const GURL& requesting_frame, | 28 const GURL& requesting_frame, |
30 base::Callback<void(bool)> callback) = 0; | 29 base::Callback<void(bool)> callback) = 0; |
31 | 30 |
32 // The renderer is cancelling a pending permission request. | 31 // The renderer is cancelling a pending permission request. |
33 virtual void CancelGeolocationPermissionRequest( | 32 virtual void CancelGeolocationPermissionRequest( |
34 int render_process_id, int render_view_id, int bridge_id, | 33 const GeolocationPermissionRequestID& id, |
35 const GURL& requesting_frame) = 0; | 34 const GURL& requesting_frame) = 0; |
36 | 35 |
37 protected: | 36 protected: |
38 virtual ~GeolocationPermissionContext() {} | 37 virtual ~GeolocationPermissionContext() {} |
39 | 38 |
40 private: | 39 private: |
41 friend class base::RefCountedThreadSafe<GeolocationPermissionContext>; | 40 friend class base::RefCountedThreadSafe<GeolocationPermissionContext>; |
42 }; | 41 }; |
43 | 42 |
44 } // namespace content | 43 } // namespace content |
45 | 44 |
46 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ | 45 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ |
OLD | NEW |