Index: chrome/browser/guest_view/web_view/web_view_guest.h |
diff --git a/chrome/browser/guest_view/web_view/web_view_guest.h b/chrome/browser/guest_view/web_view/web_view_guest.h |
index 97a7452f62a6248abb7e7574520c6ff58c77fb1b..32defb5c87197e7ad491a23e44485151e5cb52e2 100644 |
--- a/chrome/browser/guest_view/web_view/web_view_guest.h |
+++ b/chrome/browser/guest_view/web_view/web_view_guest.h |
@@ -196,35 +196,11 @@ class WebViewGuest : public GuestView<WebViewGuest>, |
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); |
- void OnWebViewMediaPermissionResponse( |
- const content::MediaStreamRequest& request, |
- const content::MediaResponseCallback& callback, |
- bool allow, |
- const std::string& user_input); |
- |
- void OnWebViewDownloadPermissionResponse( |
- const base::Callback<void(bool)>& callback, |
- bool allow, |
- const std::string& user_input); |
- |
- void OnWebViewPointerLockPermissionResponse( |
- const base::Callback<void(bool)>& callback, |
- bool allow, |
- const std::string& user_input); |
- |
- void OnWebViewNewWindowResponse(int new_window_instance_id, |
- bool allow, |
- const std::string& user_input); |
+ void RequestFileSystemPermission(const GURL& url, |
+ bool allowed_by_default, |
+ const base::Callback<void(bool)>& callback); |
enum PermissionResponseAction { |
DENY, |
@@ -267,6 +243,39 @@ class WebViewGuest : public GuestView<WebViewGuest>, |
return script_executor_.get(); |
} |
+ // Called when file system access is requested by the guest content using the |
+ // asynchronous HTML5 file system API. The request is plumbed through the |
+ // <webview> permission request API. The request will be: |
+ // - Allowed if the embedder explicitly allowed it. |
+ // - Denied if the embedder explicitly denied. |
+ // - Determined by the guest's content settings if the embedder does not |
+ // perform an explicit action. |
+ // If access was blocked due to the page's content settings, |
+ // |blocked_by_policy| should be true, and this function should invoke |
+ // OnContentBlocked. |
+ static void FileSystemAccessedAsync(int render_process_id, |
+ int render_frame_id, |
+ int request_id, |
+ const GURL& url, |
+ bool blocked_by_policy); |
+ |
+ // Called when file system access is requested by the guest content using the |
+ // synchronous HTML5 file system API in a worker thread or shared worker. The |
+ // request is plumbed through the <webview> permission request API. The |
+ // request will be: |
+ // - Allowed if the embedder explicitly allowed it. |
+ // - Denied if the embedder explicitly denied. |
+ // - Determined by the guest's content settings if the embedder does not |
+ // perform an explicit action. |
+ // If access was blocked due to the page's content settings, |
+ // |blocked_by_policy| should be true, and this function should invoke |
+ // OnContentBlocked. |
+ static void FileSystemAccessedSync(int render_process_id, |
+ int render_frame_id, |
+ const GURL& url, |
+ bool blocked_by_policy, |
+ IPC::Message* reply_msg); |
+ |
private: |
virtual ~WebViewGuest(); |
@@ -289,6 +298,50 @@ class WebViewGuest : public GuestView<WebViewGuest>, |
static scoped_ptr<base::ListValue> MenuModelToValue( |
const ui::SimpleMenuModel& menu_model); |
+ void OnWebViewGeolocationPermissionResponse( |
+ int bridge_id, |
+ bool user_gesture, |
+ const base::Callback<void(bool)>& callback, |
+ bool allow, |
+ const std::string& user_input); |
+ |
+ void OnWebViewFileSystemPermissionResponse( |
+ const base::Callback<void(bool)>& callback, |
+ bool allow, |
+ const std::string& user_input); |
+ |
+ void OnWebViewMediaPermissionResponse( |
+ const content::MediaStreamRequest& request, |
+ const content::MediaResponseCallback& callback, |
+ bool allow, |
+ const std::string& user_input); |
+ |
+ void OnWebViewDownloadPermissionResponse( |
+ const base::Callback<void(bool)>& callback, |
+ bool allow, |
+ const std::string& user_input); |
+ |
+ void OnWebViewPointerLockPermissionResponse( |
+ const base::Callback<void(bool)>& callback, |
+ bool allow, |
+ const std::string& user_input); |
+ |
+ void OnWebViewNewWindowResponse(int new_window_instance_id, |
+ bool allow, |
+ const std::string& user_input); |
+ |
+ static void FileSystemAccessedAsyncResponse(int render_process_id, |
+ int render_frame_id, |
+ int request_id, |
+ const GURL& url, |
+ bool allowed); |
+ |
+ static void FileSystemAccessedSyncResponse(int render_process_id, |
+ int render_frame_id, |
+ const GURL& url, |
+ IPC::Message* reply_msg, |
+ bool allowed); |
+ |
// WebContentsObserver implementation. |
virtual void DidCommitProvisionalLoadForFrame( |
int64 frame_id, |