| 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 CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID
_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ |
| 6 #define CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID
_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/content_settings/permission_request_id.h" | 8 #include "chrome/browser/content_settings/permission_request_id.h" |
| 9 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 9 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class WebContents; | 13 class WebContents; |
| 14 } | 14 } |
| 15 | 15 |
| 16 class GoogleLocationSettingsHelper; | 16 class GoogleLocationSettingsHelper; |
| 17 | 17 |
| 18 // Android-specific geolocation permission flow, taking into account the | 18 // Android-specific geolocation permission flow, taking into account the |
| 19 // Google Location Settings, if available. | 19 // Google Location Settings, if available. |
| 20 class ChromeGeolocationPermissionContextAndroid | 20 class GeolocationPermissionContextAndroid |
| 21 : public ChromeGeolocationPermissionContext { | 21 : public GeolocationPermissionContext { |
| 22 public: | 22 public: |
| 23 explicit ChromeGeolocationPermissionContextAndroid(Profile* profile); | 23 explicit GeolocationPermissionContextAndroid(Profile* profile); |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 struct PermissionRequestInfo { | 26 struct PermissionRequestInfo { |
| 27 PermissionRequestInfo(); | 27 PermissionRequestInfo(); |
| 28 | 28 |
| 29 PermissionRequestID id; | 29 PermissionRequestID id; |
| 30 GURL requesting_frame; | 30 GURL requesting_frame; |
| 31 bool user_gesture; | 31 bool user_gesture; |
| 32 GURL embedder; | 32 GURL embedder; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 friend class ChromeGeolocationPermissionContext; | 35 friend class GeolocationPermissionContext; |
| 36 | 36 |
| 37 virtual ~ChromeGeolocationPermissionContextAndroid(); | 37 virtual ~GeolocationPermissionContextAndroid(); |
| 38 | 38 |
| 39 // ChromeGeolocationPermissionContext implementation: | 39 // GeolocationPermissionContext implementation: |
| 40 virtual void DecidePermission(content::WebContents* web_contents, | 40 virtual void DecidePermission(content::WebContents* web_contents, |
| 41 const PermissionRequestID& id, | 41 const PermissionRequestID& id, |
| 42 const GURL& requesting_frame, | 42 const GURL& requesting_frame, |
| 43 bool user_gesture, | 43 bool user_gesture, |
| 44 const GURL& embedder, | 44 const GURL& embedder, |
| 45 const std::string& accept_button_label, | 45 const std::string& accept_button_label, |
| 46 base::Callback<void(bool)> callback) OVERRIDE; | 46 base::Callback<void(bool)> callback) OVERRIDE; |
| 47 | 47 |
| 48 virtual void PermissionDecided(const PermissionRequestID& id, | 48 virtual void PermissionDecided(const PermissionRequestID& id, |
| 49 const GURL& requesting_frame, | 49 const GURL& requesting_frame, |
| 50 const GURL& embedder, | 50 const GURL& embedder, |
| 51 base::Callback<void(bool)> callback, | 51 base::Callback<void(bool)> callback, |
| 52 bool allowed) OVERRIDE; | 52 bool allowed) OVERRIDE; |
| 53 | 53 |
| 54 void ProceedDecidePermission(content::WebContents* web_contents, | 54 void ProceedDecidePermission(content::WebContents* web_contents, |
| 55 const PermissionRequestInfo& info, | 55 const PermissionRequestInfo& info, |
| 56 const std::string& accept_button_label, | 56 const std::string& accept_button_label, |
| 57 base::Callback<void(bool)> callback); | 57 base::Callback<void(bool)> callback); |
| 58 | 58 |
| 59 scoped_ptr<GoogleLocationSettingsHelper> google_location_settings_helper_; | 59 scoped_ptr<GoogleLocationSettingsHelper> google_location_settings_helper_; |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 void CheckMasterLocation(content::WebContents* web_contents, | 62 void CheckMasterLocation(content::WebContents* web_contents, |
| 63 const PermissionRequestInfo& info, | 63 const PermissionRequestInfo& info, |
| 64 base::Callback<void(bool)> callback); | 64 base::Callback<void(bool)> callback); |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContextAndroid); | 66 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContextAndroid); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 #endif // CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDR
OID_H_ | 69 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ |
| OLD | NEW |