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

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

Issue 330143002: Simplify geolocation permission request in the Content API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID _H_
6 #define CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDROID _H_
7
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"
11
12 namespace content {
13 class WebContents;
14 }
15
16 class GoogleLocationSettingsHelper;
17
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);
24
25 private:
26 struct PermissionRequestInfo {
27 PermissionRequestInfo();
28
29 PermissionRequestID id;
30 GURL requesting_frame;
31 bool user_gesture;
32 GURL embedder;
33 };
34
35 friend class ChromeGeolocationPermissionContext;
36
37 virtual ~ChromeGeolocationPermissionContextAndroid();
38
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;
47
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;
53
54 void ProceedDecidePermission(content::WebContents* web_contents,
55 const PermissionRequestInfo& info,
56 const std::string& accept_button_label,
57 base::Callback<void(bool)> callback);
58
59 scoped_ptr<GoogleLocationSettingsHelper> google_location_settings_helper_;
60
61 private:
62 void CheckMasterLocation(content::WebContents* web_contents,
63 const PermissionRequestInfo& info,
64 base::Callback<void(bool)> callback);
65
66 DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContextAndroid);
67 };
68
69 #endif // CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_ANDR OID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698