Index: content/browser/web_contents/navigation_controller_impl.cc |
diff --git a/content/browser/web_contents/navigation_controller_impl.cc b/content/browser/web_contents/navigation_controller_impl.cc |
index bd6971646b8d428103ed5fcb13eb1b9d226ebf1e..f6f87d5a70448b3792a687d6b8264048281b4e40 100644 |
--- a/content/browser/web_contents/navigation_controller_impl.cc |
+++ b/content/browser/web_contents/navigation_controller_impl.cc |
@@ -442,11 +442,12 @@ NavigationEntry* NavigationControllerImpl::GetLastCommittedEntry() const { |
} |
bool NavigationControllerImpl::CanViewSource() const { |
- bool is_supported_mime_type = net::IsSupportedNonImageMimeType( |
- web_contents_->GetContentsMimeType().c_str()); |
+ const std::string& mime_type = web_contents_->GetContentsMimeType(); |
+ bool is_viewable_mime_type = net::IsSupportedNonImageMimeType(mime_type) && |
+ !net::IsSupportedMediaMimeType(mime_type); |
NavigationEntry* active_entry = GetActiveEntry(); |
return active_entry && !active_entry->IsViewSourceMode() && |
- is_supported_mime_type && !web_contents_->GetInterstitialPage(); |
+ is_viewable_mime_type && !web_contents_->GetInterstitialPage(); |
} |
int NavigationControllerImpl::GetLastCommittedEntryIndex() const { |