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

Unified Diff: chrome/browser/guest_view/web_view/web_view_guest.h

Issue 306473012: Plumb file system permission into WebviewGuest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes are made. Created 6 years, 7 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/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 f7b6d2ba0a7ee606a241e1cb30202a32031a3d32..41d27ab4512d29e8b2b08f954a9df6e60d51e289 100644
--- a/chrome/browser/guest_view/web_view/web_view_guest.h
+++ b/chrome/browser/guest_view/web_view/web_view_guest.h
@@ -172,35 +172,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,
@@ -243,6 +219,38 @@ class WebViewGuest : public GuestView<WebViewGuest>,
return script_executor_.get();
}
+ // Called when a specific file system in the current page of a webview guest
+ // was accessed. It will ask the embbedder whether the guest has the
fsamuel 2014/05/30 19:46:51 Called when file system access is requested by the
Xi Han 2014/05/30 20:27:46 Done.
+ // permission to request file system. The access will be:
+ // denied if the guest doesn't have permission;
+ // allowed if the guest have a permission;
+ // determined by the guest's content settings if embbedder doesn't sepcify the
+ // permission.
+ // If access was blocked due to the user'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 a specific file system in the current page of a webview guest
+ // was accessed. It will ask the embbedder whether the guest has the
+ // permission to request file system. The access will be:
+ // denied if the guest doesn't have permission;
+ // allowed if the guest have a permission;
+ // determined by the guest's content settings if embbedder doesn't sepcify the
+ // permission.
+ // If access was blocked due to the user's content settings,
+ // |blocked_by_policy| should be true, and this function should invoke
+ // OnContentBlocked.
fsamuel 2014/05/30 19:46:51 Called when file system access is requested by the
Xi Han 2014/05/30 20:27:46 Done.
+ static void FileSystemAccessedSync(int render_process_id,
+ int render_frame_id,
+ const GURL& url,
+ IPC::Message* reply_msg,
+ bool blocked_by_policy);
+
private:
virtual ~WebViewGuest();
@@ -264,6 +272,49 @@ class WebViewGuest : public GuestView<WebViewGuest>,
// Returns the top level items (ignoring submenus) as Value.
static scoped_ptr<base::ListValue> MenuModelToValue(
const ui::SimpleMenuModel& menu_model);
fsamuel 2014/05/30 19:46:51 space between this and the next method.
Xi Han 2014/05/30 20:27:46 Done.
+ 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(

Powered by Google App Engine
This is Rietveld 408576698