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

Unified Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 11775002: Media Documents should disable View [Page] Source (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed extra string copy Created 7 years, 11 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/tab_contents/view_source_browsertest.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « chrome/browser/tab_contents/view_source_browsertest.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698