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

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: 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
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f261277516fc2df3d355d83d3202924ada5ae1d8 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
@@ -325,6 +329,7 @@ void WebIntentsRegistry::OnWebIntentsDefaultsResultReceived(
if (default_service.user_date <= 0) {
for (size_t i = 0; i < sizeof(kQuickOfficeViewerMimeType) / sizeof(char*);
++i) {
+ LOG(INFO) << "Adding default for QO";
Randy Smith (Not in Mondays) 2012/08/16 20:54:41 Remove before landing.
Greg Billock 2012/08/16 21:06:03 Got rid of this and other logging crap.
DefaultWebIntentService qoviewer_service;
qoviewer_service.action = ASCIIToUTF16(kViewActionURL);
qoviewer_service.type = ASCIIToUTF16(kQuickOfficeViewerMimeType[i]);
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698