Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: chrome/browser/geolocation/geolocation_permission_context.h

Issue 2110343002: Reintroduce plumbing for user gesture into permission system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_
6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ 6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/geolocation/geolocation_permission_context_extensions.h " 10 #include "chrome/browser/geolocation/geolocation_permission_context_extensions.h "
(...skipping 11 matching lines...) Expand all
22 explicit GeolocationPermissionContext(Profile* profile); 22 explicit GeolocationPermissionContext(Profile* profile);
23 ~GeolocationPermissionContext() override; 23 ~GeolocationPermissionContext() override;
24 24
25 // In addition to the base class flow the geolocation permission decision 25 // In addition to the base class flow the geolocation permission decision
26 // checks that it is only code from valid iframes. 26 // checks that it is only code from valid iframes.
27 // It also adds special logic when called through an extension. 27 // It also adds special logic when called through an extension.
28 void DecidePermission(content::WebContents* web_contents, 28 void DecidePermission(content::WebContents* web_contents,
29 const PermissionRequestID& id, 29 const PermissionRequestID& id,
30 const GURL& requesting_origin, 30 const GURL& requesting_origin,
31 const GURL& embedding_origin, 31 const GURL& embedding_origin,
32 bool user_gesture,
32 const BrowserPermissionCallback& callback) override; 33 const BrowserPermissionCallback& callback) override;
33 34
34 // Adds special logic when called through an extension. 35 // Adds special logic when called through an extension.
35 void CancelPermissionRequest(content::WebContents* web_contents, 36 void CancelPermissionRequest(content::WebContents* web_contents,
36 const PermissionRequestID& id) override; 37 const PermissionRequestID& id) override;
37 38
38 private: 39 private:
39 void UpdateTabContext(const PermissionRequestID& id, 40 void UpdateTabContext(const PermissionRequestID& id,
40 const GURL& requesting_frame, 41 const GURL& requesting_frame,
41 bool allowed) override; 42 bool allowed) override;
42 bool IsRestrictedToSecureOrigins() const override; 43 bool IsRestrictedToSecureOrigins() const override;
43 44
44 // This must only be accessed from the UI thread. 45 // This must only be accessed from the UI thread.
45 GeolocationPermissionContextExtensions extensions_context_; 46 GeolocationPermissionContextExtensions extensions_context_;
46 47
47 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContext); 48 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContext);
48 }; 49 };
49 50
50 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ 51 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698