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