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

Unified Diff: chrome/browser/translate/translate_manager.cc

Issue 19857005: Do not show translate bar for MHTML files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up comments. Created 7 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/translate/translate_browser_metrics_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_manager.cc
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc
index 057084e3b9950effa69673d29dd0736f721a0350..a7df9931d9768c08051ccd6ec1cd117d476c04a2 100644
--- a/chrome/browser/translate/translate_manager.cc
+++ b/chrome/browser/translate/translate_manager.cc
@@ -332,6 +332,14 @@ void TranslateManager::InitiateTranslation(WebContents* web_contents,
return;
}
+ // MHTML pages currently cannot be translated.
+ // See bug: 217945.
+ if (web_contents->GetContentsMimeType() == "multipart/related") {
+ TranslateBrowserMetrics::ReportInitiationStatus(
+ TranslateBrowserMetrics::INITIATION_STATUS_MIME_TYPE_IS_NOT_SUPPORTED);
+ return;
+ }
+
// Don't translate any Chrome specific page, e.g., New Tab Page, Download,
// History, and so on.
GURL page_url = web_contents->GetURL();
« no previous file with comments | « chrome/browser/translate/translate_browser_metrics_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698