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

Side by Side 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: Changes as per review comments. 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 if (!core_tab_helper) 1139 if (!core_tab_helper)
1140 return false; 1140 return false;
1141 1141
1142 CoreTabHelperDelegate* core_delegate = core_tab_helper->delegate(); 1142 CoreTabHelperDelegate* core_delegate = core_tab_helper->delegate();
1143 return !core_delegate || 1143 return !core_delegate ||
1144 core_delegate->CanReloadContents(embedder_web_contents_); 1144 core_delegate->CanReloadContents(embedder_web_contents_);
1145 } 1145 }
1146 1146
1147 case IDC_VIEW_SOURCE: 1147 case IDC_VIEW_SOURCE:
1148 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: 1148 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE:
1149 return embedder_web_contents_->GetController().CanViewSource(); 1149 return (params_.media_type != WebContextMenuData::MediaTypePlugin) &&
1150 embedder_web_contents_->GetController().CanViewSource();
1150 1151
1151 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: 1152 case IDC_CONTENT_CONTEXT_INSPECTELEMENT:
1152 case IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE: 1153 case IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE:
1153 case IDC_CONTENT_CONTEXT_RELOAD_PACKAGED_APP: 1154 case IDC_CONTENT_CONTEXT_RELOAD_PACKAGED_APP:
1154 case IDC_CONTENT_CONTEXT_RESTART_PACKAGED_APP: 1155 case IDC_CONTENT_CONTEXT_RESTART_PACKAGED_APP:
1155 return IsDevCommandEnabled(id); 1156 return IsDevCommandEnabled(id);
1156 1157
1157 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: 1158 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO:
1158 if (embedder_web_contents_->GetController().GetVisibleEntry() == NULL) 1159 if (embedder_web_contents_->GetController().GetVisibleEntry() == NULL)
1159 return false; 1160 return false;
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 source_web_contents_->GetRenderViewHost()-> 1948 source_web_contents_->GetRenderViewHost()->
1948 ExecuteMediaPlayerActionAtLocation(location, action); 1949 ExecuteMediaPlayerActionAtLocation(location, action);
1949 } 1950 }
1950 1951
1951 void RenderViewContextMenu::PluginActionAt( 1952 void RenderViewContextMenu::PluginActionAt(
1952 const gfx::Point& location, 1953 const gfx::Point& location,
1953 const WebPluginAction& action) { 1954 const WebPluginAction& action) {
1954 source_web_contents_->GetRenderViewHost()-> 1955 source_web_contents_->GetRenderViewHost()->
1955 ExecutePluginActionAtLocation(location, action); 1956 ExecutePluginActionAtLocation(location, action);
1956 } 1957 }
OLDNEW
« 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