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

Unified Diff: url/url_parse.h

Issue 19857005: Do not show translate bar for MHTML files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add and use GURL::ExtractFileExtension() Created 7 years, 5 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: url/url_parse.h
diff --git a/url/url_parse.h b/url/url_parse.h
index 21033ddbbf6c9a056789564776417cffa2841e79..a5261859558aff9f8c56c99305bd58a0bf0aa423 100644
--- a/url/url_parse.h
+++ b/url/url_parse.h
@@ -332,6 +332,20 @@ URL_EXPORT void ExtractFileName(const base::char16* url,
const Component& path,
Component* file_name);
+// Extracts the range of the file extension in the given url. It uses
+// ExtractFileName() to extract the file name first. The file extension is
+// defined all characters following the last dot in the file name, unless the
+// last dot is the first character of the file name.
+//
+// The file extension will be empty if the file name is empty or there is no
+// extension in the file name.
+URL_EXPORT void ExtractFileExtension(const char* url,
+ const Component& path,
+ Component* file_extension);
+URL_EXPORT void ExtractFileExtension(const base::char16* url,
+ const Component& path,
+ Component* file_extension);
+
// Extract the first key/value from the range defined by |*query|. Updates
// |*query| to start at the end of the extracted key/value pair. This is
// designed for use in a loop: you can keep calling it with the same query

Powered by Google App Engine
This is Rietveld 408576698