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

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: Fix indentation 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..cdcc6a8c67251553da8d88c275922afadde3514e 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().c_str();
Avi (use Gerrit) 2013/01/07 19:36:11 GetContentsMimeType() already returns a std::strin
wolenetz 2013/01/08 19:17:34 Good point. I'll upload another PS with this fixe
+ 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