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 if (!!extensions::MimeHandlerViewGuest::FromWebContents( |
| 1157 source_web_contents_)) { |
| 1158 return false; |
| 1159 } |
1156 return (params_.media_type != WebContextMenuData::MediaTypePlugin) && | 1160 return (params_.media_type != WebContextMenuData::MediaTypePlugin) && |
1157 embedder_web_contents_->GetController().CanViewSource(); | 1161 embedder_web_contents_->GetController().CanViewSource(); |
1158 | 1162 |
1159 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: | 1163 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: |
1160 case IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE: | 1164 case IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE: |
1161 case IDC_CONTENT_CONTEXT_RELOAD_PACKAGED_APP: | 1165 case IDC_CONTENT_CONTEXT_RELOAD_PACKAGED_APP: |
1162 case IDC_CONTENT_CONTEXT_RESTART_PACKAGED_APP: | 1166 case IDC_CONTENT_CONTEXT_RESTART_PACKAGED_APP: |
1163 return IsDevCommandEnabled(id); | 1167 return IsDevCommandEnabled(id); |
1164 | 1168 |
1165 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: | 1169 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1977 source_web_contents_->GetRenderViewHost()-> | 1981 source_web_contents_->GetRenderViewHost()-> |
1978 ExecuteMediaPlayerActionAtLocation(location, action); | 1982 ExecuteMediaPlayerActionAtLocation(location, action); |
1979 } | 1983 } |
1980 | 1984 |
1981 void RenderViewContextMenu::PluginActionAt( | 1985 void RenderViewContextMenu::PluginActionAt( |
1982 const gfx::Point& location, | 1986 const gfx::Point& location, |
1983 const WebPluginAction& action) { | 1987 const WebPluginAction& action) { |
1984 source_web_contents_->GetRenderViewHost()-> | 1988 source_web_contents_->GetRenderViewHost()-> |
1985 ExecutePluginActionAtLocation(location, action); | 1989 ExecutePluginActionAtLocation(location, action); |
1986 } | 1990 } |
OLD | NEW |