Popular sites on the NTP: re-download popular suggestions once per Chrome run
[chromium-blink-merge.git] / chrome / browser / geolocation / geolocation_permission_context_extensions.h
bloba7bcaf97a9e657436e02643bd8b12d8f065543d9
1 // Copyright 2014 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_GEOLOCATION_PERMISSION_CONTEXT_EXTENSIONS_H_
6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_EXTENSIONS_H_
8 #include "base/callback_forward.h"
9 #include "base/macros.h"
10 #include "components/content_settings/core/common/content_settings.h"
12 namespace content {
13 class WebContents;
16 class GURL;
17 class PermissionRequestID;
18 class Profile;
20 // Chrome extensions specific portions of GeolocationPermissionContext.
21 class GeolocationPermissionContextExtensions {
22 public:
23 explicit GeolocationPermissionContextExtensions(Profile* profile);
24 ~GeolocationPermissionContextExtensions();
26 // Returns true if the permission request was handled. In which case,
27 // |permission_set| will be set to true if the permission changed, and the
28 // permission has been set to |new_permission|.
29 bool RequestPermission(content::WebContents* web_contents,
30 const PermissionRequestID& request_id,
31 int bridge_id,
32 const GURL& requesting_frame,
33 bool user_gesture,
34 const base::Callback<void(ContentSetting)>& callback,
35 bool* permission_set,
36 bool* new_permission);
38 // Returns true if the cancellation request was handled.
39 bool CancelPermissionRequest(content::WebContents* web_contents,
40 int bridge_id);
42 private:
43 Profile* profile_;
45 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContextExtensions);
48 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_EXTENSIONS_H_