summaryrefslogtreecommitdiffstats
path: root/chrome/browser/geolocation/chrome_geolocation_permission_context_android.h
blob: 0dbed899eb10d72dd113c2d1a3fbca3731482adf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_
#define CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_

#include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"

class GoogleLocationSettingsHelper;

// Android-specific geolocation permission flow, taking into account the
// Google Location Settings, if available.
class ChromeGeolocationPermissionContextAndroid
    : public ChromeGeolocationPermissionContext {
 public:
  explicit ChromeGeolocationPermissionContextAndroid(Profile* profile);

 private:
  friend class ChromeGeolocationPermissionContext;

  virtual ~ChromeGeolocationPermissionContextAndroid();

  // ChromeGeolocationPermissionContext implementation:
  virtual void DecidePermission(const GeolocationPermissionRequestID& id,
                                const GURL& requesting_frame,
                                const GURL& embedder,
                                base::Callback<void(bool)> callback) OVERRIDE;

  virtual void PermissionDecided(const GeolocationPermissionRequestID& id,
                                 const GURL& requesting_frame,
                                 const GURL& embedder,
                                 base::Callback<void(bool)> callback,
                                 bool allowed) OVERRIDE;

  scoped_ptr<GoogleLocationSettingsHelper> google_location_settings_helper_;

  DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContextAndroid);
};

#endif  // CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_