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

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 1305043003: Unncessary 'View source code' option is enabled in context menu of the 'Pdf Viewer' app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change for new approach. Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index e7b57ee9ec29b050e78c5c5b519e5f7d9eddf515..6f836cdea6d9bb11b4e96432c2f1f6834995f6fa 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -1146,6 +1146,11 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
case IDC_VIEW_SOURCE:
case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE:
+ // If we're viewing in a MimeHandlerViewGuest source should not be shown.
AKV 2015/09/05 11:15:32 Please protect it using ENABLE_EXTENSIONS flag.
Deepak 2015/09/05 11:52:14 Done.
+ if (extensions::MimeHandlerViewGuest::FromWebContents(
+ source_web_contents_)) {
AKV 2015/09/05 11:15:32 Please indent to 4 spaces instead of 8
Deepak 2015/09/05 11:52:14 Done.
+ return false;
AKV 2015/09/05 11:15:32 nit: single line body block doesn't need braces.
Deepak 2015/09/05 11:52:14 Done.
+ }
return embedder_web_contents_->GetController().CanViewSource();
case IDC_CONTENT_CONTEXT_INSPECTELEMENT:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698