| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTENSIONS_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_EXTENSIONS_H_ |
| 6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_EXTENSIONS_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_EXTENSIONS_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/content_settings/core/common/content_settings.h" | 10 #include "components/content_settings/core/common/content_settings.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class WebContents; | 13 class WebContents; |
| 14 } | 14 } |
| 15 | 15 |
| 16 class GURL; | 16 namespace url { |
| 17 class Origin; |
| 18 } |
| 19 |
| 17 class PermissionRequestID; | 20 class PermissionRequestID; |
| 18 class Profile; | 21 class Profile; |
| 19 | 22 |
| 20 // Chrome extensions specific portions of GeolocationPermissionContext. | 23 // Chrome extensions specific portions of GeolocationPermissionContext. |
| 21 class GeolocationPermissionContextExtensions { | 24 class GeolocationPermissionContextExtensions { |
| 22 public: | 25 public: |
| 23 explicit GeolocationPermissionContextExtensions(Profile* profile); | 26 explicit GeolocationPermissionContextExtensions(Profile* profile); |
| 24 ~GeolocationPermissionContextExtensions(); | 27 ~GeolocationPermissionContextExtensions(); |
| 25 | 28 |
| 26 // Returns true if the permission request was handled. In which case, | 29 // Returns true if the permission request was handled. In which case, |
| 27 // |permission_set| will be set to true if the permission changed, and the | 30 // |permission_set| will be set to true if the permission changed, and the |
| 28 // permission has been set to |new_permission|. | 31 // permission has been set to |new_permission|. |
| 29 bool DecidePermission(content::WebContents* web_contents, | 32 bool DecidePermission(content::WebContents* web_contents, |
| 30 const PermissionRequestID& request_id, | 33 const PermissionRequestID& request_id, |
| 31 int bridge_id, | 34 int bridge_id, |
| 32 const GURL& requesting_frame, | 35 const url::Origin& requesting_frame, |
| 33 const base::Callback<void(ContentSetting)>& callback, | 36 const base::Callback<void(ContentSetting)>& callback, |
| 34 bool* permission_set, | 37 bool* permission_set, |
| 35 bool* new_permission); | 38 bool* new_permission); |
| 36 | 39 |
| 37 // Returns true if the cancellation request was handled. | 40 // Returns true if the cancellation request was handled. |
| 38 bool CancelPermissionRequest(content::WebContents* web_contents, | 41 bool CancelPermissionRequest(content::WebContents* web_contents, |
| 39 int bridge_id); | 42 int bridge_id); |
| 40 | 43 |
| 41 private: | 44 private: |
| 42 Profile* profile_; | 45 Profile* profile_; |
| 43 | 46 |
| 44 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContextExtensions); | 47 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContextExtensions); |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_EXTENSIONS_
H_ | 50 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_EXTENSIONS_
H_ |
| OLD | NEW |