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

Unified Diff: chrome/browser/intents/web_intents_registry.cc

Issue 10830363: intents: Add conditional web intents dispatch for docs types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Kill superfluous logging. Created 8 years, 4 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/intents/web_intents_registry.cc
diff --git a/chrome/browser/intents/web_intents_registry.cc b/chrome/browser/intents/web_intents_registry.cc
index 2dd700063ac28fc45566602ba19e54017477793f..eea38a6739b7a39f565ae70d32a02b2192624786 100644
--- a/chrome/browser/intents/web_intents_registry.cc
+++ b/chrome/browser/intents/web_intents_registry.cc
@@ -49,9 +49,13 @@ bool MimeTypesAreEqual(const string16& type1, const string16& type2) {
// We don't have a MIME matcher that allows patterns on both sides
// Instead, we do two comparisons, treating each type in turn as a
// pattern. If either one matches, we consider this a MIME match.
- if (net::MatchesMimeType(UTF16ToUTF8(type1), UTF16ToUTF8(type2)))
+ std::string t1 = UTF16ToUTF8(type1);
+ std::string t2 = UTF16ToUTF8(type2);
+ StringToLowerASCII(&t1);
+ StringToLowerASCII(&t2);
+ if (net::MatchesMimeType(t1, t2))
return true;
- return net::MatchesMimeType(UTF16ToUTF8(type2), UTF16ToUTF8(type1));
+ return net::MatchesMimeType(t2, t1);
}
// Returns true if the passed string is a MIME type. Works by comparing string

Powered by Google App Engine
This is Rietveld 408576698