Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / geolocation / chrome_geolocation_permission_context_android.h
blobcd8e69d35e78d57cc3162b0f4c457d7c4191f5be
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"
10 #include "url/gurl.h"
12 namespace content {
13 class WebContents;
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 {
22 public:
23 explicit ChromeGeolocationPermissionContextAndroid(Profile* profile);
25 private:
26 struct PermissionRequestInfo {
27 PermissionRequestInfo();
29 PermissionRequestID id;
30 GURL requesting_frame;
31 bool user_gesture;
32 GURL embedder;
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,
43 bool user_gesture,
44 const GURL& embedder,
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,
50 const GURL& embedder,
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_;
61 private:
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_