Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1146 if (!core_tab_helper) | 1146 if (!core_tab_helper) |
| 1147 return false; | 1147 return false; |
| 1148 | 1148 |
| 1149 CoreTabHelperDelegate* core_delegate = core_tab_helper->delegate(); | 1149 CoreTabHelperDelegate* core_delegate = core_tab_helper->delegate(); |
| 1150 return !core_delegate || | 1150 return !core_delegate || |
| 1151 core_delegate->CanReloadContents(embedder_web_contents_); | 1151 core_delegate->CanReloadContents(embedder_web_contents_); |
| 1152 } | 1152 } |
| 1153 | 1153 |
| 1154 case IDC_VIEW_SOURCE: | 1154 case IDC_VIEW_SOURCE: |
| 1155 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: | 1155 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: |
| 1156 return (params_.media_type != WebContextMenuData::MediaTypePlugin) && | 1156 // If we're viewing in a MimeHandlerViewGuest source will not be viewed. |
| 1157 return !extensions::MimeHandlerViewGuest::FromWebContents( | |
|
lazyboy
2015/10/08 18:35:39
Wouldn't this start showing view source for plugin
Deepak
2015/10/09 05:29:05
"view source" for the plugin elements will be disa
lazyboy
2015/10/09 15:46:38
For regular plugins (not PDF, say flash), we'd get
| |
| 1158 source_web_contents_) && | |
| 1157 embedder_web_contents_->GetController().CanViewSource(); | 1159 embedder_web_contents_->GetController().CanViewSource(); |
| 1158 | 1160 |
| 1159 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: | 1161 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: |
| 1160 case IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE: | 1162 case IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE: |
| 1161 case IDC_CONTENT_CONTEXT_RELOAD_PACKAGED_APP: | 1163 case IDC_CONTENT_CONTEXT_RELOAD_PACKAGED_APP: |
| 1162 case IDC_CONTENT_CONTEXT_RESTART_PACKAGED_APP: | 1164 case IDC_CONTENT_CONTEXT_RESTART_PACKAGED_APP: |
| 1163 return IsDevCommandEnabled(id); | 1165 return IsDevCommandEnabled(id); |
| 1164 | 1166 |
| 1165 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: | 1167 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: |
| 1166 if (embedder_web_contents_->GetController().GetVisibleEntry() == NULL) | 1168 if (embedder_web_contents_->GetController().GetVisibleEntry() == NULL) |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1977 source_web_contents_->GetRenderViewHost()-> | 1979 source_web_contents_->GetRenderViewHost()-> |
| 1978 ExecuteMediaPlayerActionAtLocation(location, action); | 1980 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1979 } | 1981 } |
| 1980 | 1982 |
| 1981 void RenderViewContextMenu::PluginActionAt( | 1983 void RenderViewContextMenu::PluginActionAt( |
| 1982 const gfx::Point& location, | 1984 const gfx::Point& location, |
| 1983 const WebPluginAction& action) { | 1985 const WebPluginAction& action) { |
| 1984 source_web_contents_->GetRenderViewHost()-> | 1986 source_web_contents_->GetRenderViewHost()-> |
| 1985 ExecutePluginActionAtLocation(location, action); | 1987 ExecutePluginActionAtLocation(location, action); |
| 1986 } | 1988 } |
| OLD | NEW |