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

Unified Diff: content/public/common/drop_data.h

Issue 2674953003: Only generate suggested filenames when actually dragging an image. (Closed)
Patch Set: rebase Created 3 years, 10 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/public/common/DEPS ('k') | content/public/common/drop_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/drop_data.h
diff --git a/content/public/common/drop_data.h b/content/public/common/drop_data.h
index a5439b6aeeb2bcb1755ed3aef0154dcc6def5193..204d6715de165c2b1d69e7e775fe2ed5c7e88323 100644
--- a/content/public/common/drop_data.h
+++ b/content/public/common/drop_data.h
@@ -15,6 +15,8 @@
#include <string>
#include <vector>
+#include "base/files/file_path.h"
+#include "base/optional.h"
#include "base/strings/nullable_string16.h"
#include "content/common/content_export.h"
#include "ipc/ipc_message.h"
@@ -60,12 +62,16 @@ struct CONTENT_EXPORT DropData {
DropData(const DropData& other);
~DropData();
+ // Returns a sanitized filename to use for the dragged image, or base::nullopt
+ // if no sanitized name could be synthesized.
+ base::Optional<base::FilePath> GetSafeFilenameForImageFileContents() const;
+
int view_id = MSG_ROUTING_NONE;
// Whether this drag originated from a renderer.
bool did_originate_from_renderer;
- // User is dragging a link into the webview.
+ // User is dragging a link or image.
GURL url;
base::string16 url_title; // The title associated with |url|.
@@ -98,9 +104,11 @@ struct CONTENT_EXPORT DropData {
base::NullableString16 html;
GURL html_base_url;
- // User is dragging data from the webview (e.g., an image).
- base::string16 file_description_filename;
+ // User is dragging an image out of the WebView.
std::string file_contents;
+ GURL file_contents_source_url;
+ base::FilePath::StringType file_contents_filename_extension;
+ std::string file_contents_content_disposition;
std::map<base::string16, base::string16> custom_data;
« no previous file with comments | « content/public/common/DEPS ('k') | content/public/common/drop_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698