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

Unified Diff: chrome/browser/guestview/webview/webview_guest.h

Issue 235633002: <webview>: Move Geolocation permission to chrome layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests in Debug mode Created 6 years, 8 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
Index: chrome/browser/guestview/webview/webview_guest.h
diff --git a/chrome/browser/guestview/webview/webview_guest.h b/chrome/browser/guestview/webview/webview_guest.h
index b6bb3b49cec3a5920e6f81776f87657e465b261a..02345508304b82eee9c2c9597f1c7fffab895dae 100644
--- a/chrome/browser/guestview/webview/webview_guest.h
+++ b/chrome/browser/guestview/webview/webview_guest.h
@@ -73,7 +73,7 @@ class WebViewGuest : public GuestView,
const std::string& error_type) OVERRIDE;
virtual void RendererResponsive() OVERRIDE;
virtual void RendererUnresponsive() OVERRIDE;
- virtual bool RequestPermission(
+ virtual void RequestPermission(
BrowserPluginPermissionType permission_type,
const base::DictionaryValue& request_info,
const PermissionResponseCallback& callback,
@@ -108,6 +108,21 @@ class WebViewGuest : public GuestView,
// Reload the guest.
void Reload();
+ // Requests Geolocation Permission from the embedder.
+ void RequestGeolocationPermission(int bridge_id,
+ const GURL& requesting_frame,
+ bool user_gesture,
+ const base::Callback<void(bool)>& callback);
+
+ void OnWebViewGeolocationPermissionResponse(
+ int bridge_id,
+ bool user_gesture,
+ const base::Callback<void(bool)>& callback,
+ bool allow,
+ const std::string& user_input);
+
+ void CancelGeolocationPermissionRequest(int bridge_id);
+
enum PermissionResponseAction {
DENY,
ALLOW,
@@ -219,6 +234,17 @@ class WebViewGuest : public GuestView,
void InjectChromeVoxIfNeeded(content::RenderViewHost* render_view_host);
+ // Bridge IDs correspond to a geolocation request. This method will remove
+ // the bookkeeping for a particular geolocation request associated with the
+ // provided |bridge_id|. It returns the request ID of the geolocation request.
+ int RemoveBridgeID(int bridge_id);
+
+ int RequestPermissionInternal(
+ BrowserPluginPermissionType permission_type,
+ const base::DictionaryValue& request_info,
+ const PermissionResponseCallback& callback,
+ bool allowed_by_default);
+
ObserverList<extensions::TabHelper::ScriptExecutionObserver>
script_observers_;
scoped_ptr<extensions::ScriptExecutor> script_executor_;
@@ -260,6 +286,8 @@ class WebViewGuest : public GuestView,
accessibility_subscription_;
#endif
+ std::map<int, int> bridge_id_to_request_id_map_;
+
DISALLOW_COPY_AND_ASSIGN(WebViewGuest);
};
« no previous file with comments | « chrome/browser/guestview/webview/webview_constants.cc ('k') | chrome/browser/guestview/webview/webview_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698