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

Unified Diff: content/renderer/render_frame_impl.h

Issue 2050623005: Move file chooser from RenderView(Host) to RenderFrame(Host). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on reviews. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/pepper_file_chooser_host_unittest.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.h
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 261ed1c23ecf853051eaf412c275a4d10a8158fb..a53eb87dff53353147551ce2de8c67df43d5f13f 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -152,6 +152,8 @@ class UserMediaClientImpl;
class WakeLockDispatcher;
struct CommonNavigationParams;
struct CustomContextMenuContext;
+struct FileChooserFileInfo;
+struct FileChooserParams;
struct FrameReplicationState;
struct NavigationParams;
struct RequestNavigationParams;
@@ -541,6 +543,9 @@ class CONTENT_EXPORT RenderFrameImpl
const blink::WebString& default_value,
blink::WebString* actual_value) override;
bool runModalBeforeUnloadDialog(bool is_reload) override;
+ bool runFileChooser(
+ const blink::WebFileChooserParams& params,
+ blink::WebFileChooserCompletion* chooser_completion) override;
void showContextMenu(const blink::WebContextMenuData& data) override;
void willSendRequest(blink::WebLocalFrame* frame,
unsigned identifier,
@@ -822,6 +827,8 @@ class CONTENT_EXPORT RenderFrameImpl
void OnStopFinding(StopFindAction action);
void OnEnableViewSourceMode();
void OnSuppressFurtherDialogs();
+ void OnFileChooserResponse(
+ const std::vector<content::FileChooserFileInfo>& files);
#if defined(OS_ANDROID)
void OnActivateNearestFindResult(int request_id, float x, float y);
void OnGetNearestFindResult(int request_id, float x, float y);
@@ -893,6 +900,15 @@ class CONTENT_EXPORT RenderFrameImpl
const GURL& frame_url,
base::string16* result);
+ // Adds the given file chooser request to the file_chooser_completion_ queue
+ // (see that var for more) and requests the chooser be displayed if there are
+ // no other waiting items in the queue.
+ //
+ // Returns true if the chooser was successfully scheduled. False means we
+ // didn't schedule anything.
+ bool ScheduleFileChooser(const FileChooserParams& params,
+ blink::WebFileChooserCompletion* completion);
+
// Loads the appropriate error page for the specified failure into the frame.
void LoadNavigationErrorPage(const blink::WebURLRequest& failed_request,
const blink::WebURLError& error,
@@ -1229,6 +1245,13 @@ class CONTENT_EXPORT RenderFrameImpl
// stack that interferes with swapping out.
bool suppress_further_dialogs_;
+ // The current and pending file chooser completion objects. If the queue is
+ // nonempty, the first item represents the currently running file chooser
+ // callback, and the remaining elements are the other file chooser completion
+ // still waiting to be run (in order).
+ struct PendingFileChooser;
+ std::deque<std::unique_ptr<PendingFileChooser>> file_chooser_completions_;
+
#if defined(USE_EXTERNAL_POPUP_MENU)
// The external popup for the currently showing select popup.
std::unique_ptr<ExternalPopupMenu> external_popup_menu_;
« no previous file with comments | « content/renderer/pepper/pepper_file_chooser_host_unittest.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698