| 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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 | 946 |
| 947 menu_model_.AddSubMenu( | 947 menu_model_.AddSubMenu( |
| 948 IDC_CONTENT_CONTEXT_OPENLINKWITH, | 948 IDC_CONTENT_CONTEXT_OPENLINKWITH, |
| 949 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_OPENLINKWITH), | 949 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_OPENLINKWITH), |
| 950 &protocol_handler_submenu_model_); | 950 &protocol_handler_submenu_model_); |
| 951 } | 951 } |
| 952 | 952 |
| 953 // Menu delegate functions ----------------------------------------------------- | 953 // Menu delegate functions ----------------------------------------------------- |
| 954 | 954 |
| 955 bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { | 955 bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { |
| 956 if (RenderViewContextMenuBase::IsCommandIdEnabled(id)) | 956 { |
| 957 return true; | 957 bool enabled = false; |
| 958 if (RenderViewContextMenuBase::GetCommandIdEnabled(id, &enabled)) |
| 959 return enabled; |
| 960 } |
| 958 | 961 |
| 959 CoreTabHelper* core_tab_helper = | 962 CoreTabHelper* core_tab_helper = |
| 960 CoreTabHelper::FromWebContents(source_web_contents_); | 963 CoreTabHelper::FromWebContents(source_web_contents_); |
| 961 int content_restrictions = 0; | 964 int content_restrictions = 0; |
| 962 if (core_tab_helper) | 965 if (core_tab_helper) |
| 963 content_restrictions = core_tab_helper->content_restrictions(); | 966 content_restrictions = core_tab_helper->content_restrictions(); |
| 964 if (id == IDC_PRINT && (content_restrictions & CONTENT_RESTRICTION_PRINT)) | 967 if (id == IDC_PRINT && (content_restrictions & CONTENT_RESTRICTION_PRINT)) |
| 965 return false; | 968 return false; |
| 966 | 969 |
| 967 if (id == IDC_SAVE_PAGE && | 970 if (id == IDC_SAVE_PAGE && |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1780 source_web_contents_->GetRenderViewHost()-> | 1783 source_web_contents_->GetRenderViewHost()-> |
| 1781 ExecuteMediaPlayerActionAtLocation(location, action); | 1784 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1782 } | 1785 } |
| 1783 | 1786 |
| 1784 void RenderViewContextMenu::PluginActionAt( | 1787 void RenderViewContextMenu::PluginActionAt( |
| 1785 const gfx::Point& location, | 1788 const gfx::Point& location, |
| 1786 const WebPluginAction& action) { | 1789 const WebPluginAction& action) { |
| 1787 source_web_contents_->GetRenderViewHost()-> | 1790 source_web_contents_->GetRenderViewHost()-> |
| 1788 ExecutePluginActionAtLocation(location, action); | 1791 ExecutePluginActionAtLocation(location, action); |
| 1789 } | 1792 } |
| OLD | NEW |