Make castv2 performance test work.
[chromium-blink-merge.git] / chrome / browser / geolocation / geolocation_permission_context.h
blobaffa191d50075179eb766eda939bcf7546599440
1 // Copyright 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_GEOLOCATION_PERMISSION_CONTEXT_H_
6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_
8 #include "base/callback.h"
9 #include "chrome/browser/content_settings/permission_context_base.h"
10 #include "chrome/browser/geolocation/geolocation_permission_context_extensions.h"
12 namespace content {
13 class WebContents;
16 class PermissionRequestID;
17 class Profile;
19 class GeolocationPermissionContext : public PermissionContextBase {
20 public:
21 explicit GeolocationPermissionContext(Profile* profile);
22 ~GeolocationPermissionContext() override;
24 // In addition to the base class flow the geolocation permission request
25 // checks that it is only code from valid iframes.
26 // It also adds special logic when called through an extension.
27 void RequestPermission(content::WebContents* web_contents,
28 const PermissionRequestID& id,
29 const GURL& requesting_frame_origin,
30 bool user_gesture,
31 const BrowserPermissionCallback& callback) override;
33 // Adds special logic when called through an extension.
34 void CancelPermissionRequest(content::WebContents* web_contents,
35 const PermissionRequestID& id) override;
37 private:
38 void UpdateTabContext(const PermissionRequestID& id,
39 const GURL& requesting_frame,
40 bool allowed) override;
42 // This must only be accessed from the UI thread.
43 GeolocationPermissionContextExtensions extensions_context_;
45 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContext);
48 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_