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

Unified Diff: content/public/browser/content_browser_client.h

Issue 571483002: Refactor content client to include a single Request/CancelPermission method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@geoloc_permission
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/midi_dispatcher_host.cc ('k') | content/public/browser/content_browser_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/content_browser_client.h
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 65a5abbee97179d557c81c8985025720f92c8a07..4faf340eb63d36f99b49e4a04393924e4bccd904 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -109,6 +109,19 @@ struct Referrer;
struct ShowDesktopNotificationHostMsgParams;
struct WebPreferences;
+
+enum PermissionType {
+ PERMISSION_UNKNOWN = 0,
+ PERMISSION_MIDI_SYSEX = 1,
+ PERMISSION_PUSH_MESSAGING = 2,
+ PERMISSION_NOTIFICATIONS = 3,
+ PERMISSION_GEOLOCATION = 4,
+ PERMISSION_PROTECTED_MEDIA = 5,
+
+ // Always keep this at the end.
+ PERMISSION_NUM,
+};
+
// A mapping from the scheme name to the protocol handler that services its
// content.
typedef std::map<
@@ -435,18 +448,17 @@ class CONTENT_EXPORT ContentBrowserClient {
scoped_ptr<DesktopNotificationDelegate> delegate,
base::Closure* cancel_callback) {}
- // The renderer is requesting permission to use Geolocation. When the answer
- // to a permission request has been determined, |result_callback| should be
- // called with the result. If |cancel_callback| is non-null, it's set to a
- // callback which can be used to cancel the permission request.
- virtual void RequestGeolocationPermission(
+ virtual void RequestPermission(
+ PermissionType permission,
WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame,
bool user_gesture,
const base::Callback<void(bool)>& result_callback);
- virtual void CancelGeolocationPermissionRequest(
+
+ virtual void CancelPermissionRequest(
+ PermissionType permission,
WebContents* web_contents,
int bridge_id,
const GURL& requesting_frame);
@@ -456,26 +468,6 @@ class CONTENT_EXPORT ContentBrowserClient {
const GURL& frame_url,
const GURL& main_frame_url) {}
- // Requests a permission to use system exclusive messages in MIDI events.
- // |result_callback| will be invoked when the request is resolved. If
- // |cancel_callback| is non-null, it's set to a callback which can be used to
- // cancel the permission request.
- virtual void RequestMidiSysExPermission(
- WebContents* web_contents,
- int bridge_id,
- const GURL& requesting_frame,
- bool user_gesture,
- base::Callback<void(bool)> result_callback,
- base::Closure* cancel_callback);
-
- // Request permission to access protected media identifier. |result_callback
- // will tell whether it's permitted. If |cancel_callback| is non-null, it's
- // set to a callback which can be used to cancel the permission request.
- virtual void RequestProtectedMediaIdentifierPermission(
- WebContents* web_contents,
- const GURL& origin,
- base::Callback<void(bool)> result_callback,
- base::Closure* cancel_callback);
// Returns true if the given page is allowed to open a window of the given
// type. If true is returned, |no_javascript_access| will indicate whether
« no previous file with comments | « content/browser/media/midi_dispatcher_host.cc ('k') | content/public/browser/content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698