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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_
6 #define CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_
8 #include "chrome/browser/content_settings/permission_request_id.h"
9 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
16 class GoogleLocationSettingsHelper
;
18 // Android-specific geolocation permission flow, taking into account the
19 // Google Location Settings, if available.
20 class ChromeGeolocationPermissionContextAndroid
21 : public ChromeGeolocationPermissionContext
{
23 explicit ChromeGeolocationPermissionContextAndroid(Profile
* profile
);
26 struct PermissionRequestInfo
{
27 PermissionRequestInfo();
29 PermissionRequestID id
;
30 GURL requesting_frame
;
35 friend class ChromeGeolocationPermissionContext
;
37 virtual ~ChromeGeolocationPermissionContextAndroid();
39 // ChromeGeolocationPermissionContext implementation:
40 virtual void DecidePermission(content::WebContents
* web_contents
,
41 const PermissionRequestID
& id
,
42 const GURL
& requesting_frame
,
45 const std::string
& accept_button_label
,
46 base::Callback
<void(bool)> callback
) OVERRIDE
;
48 virtual void PermissionDecided(const PermissionRequestID
& id
,
49 const GURL
& requesting_frame
,
51 base::Callback
<void(bool)> callback
,
52 bool allowed
) OVERRIDE
;
54 void ProceedDecidePermission(content::WebContents
* web_contents
,
55 const PermissionRequestInfo
& info
,
56 const std::string
& accept_button_label
,
57 base::Callback
<void(bool)> callback
);
59 scoped_ptr
<GoogleLocationSettingsHelper
> google_location_settings_helper_
;
62 void CheckMasterLocation(content::WebContents
* web_contents
,
63 const PermissionRequestInfo
& info
,
64 base::Callback
<void(bool)> callback
);
66 DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContextAndroid
);
69 #endif // CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_