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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 void RenderViewContextMenu::AppendProtocolHandlerSubMenu() { | 1067 void RenderViewContextMenu::AppendProtocolHandlerSubMenu() { |
1068 const ProtocolHandlerRegistry::ProtocolHandlerList handlers = | 1068 const ProtocolHandlerRegistry::ProtocolHandlerList handlers = |
1069 GetHandlersForLinkUrl(); | 1069 GetHandlersForLinkUrl(); |
1070 if (handlers.empty()) | 1070 if (handlers.empty()) |
1071 return; | 1071 return; |
1072 size_t max = IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_LAST - | 1072 size_t max = IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_LAST - |
1073 IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_FIRST; | 1073 IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_FIRST; |
1074 for (size_t i = 0; i < handlers.size() && i <= max; i++) { | 1074 for (size_t i = 0; i < handlers.size() && i <= max; i++) { |
1075 protocol_handler_submenu_model_.AddItem( | 1075 protocol_handler_submenu_model_.AddItem( |
1076 IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_FIRST + i, | 1076 IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_FIRST + i, |
1077 handlers[i].title()); | 1077 base::UTF8ToUTF16(handlers[i].url().host())); |
1078 } | 1078 } |
1079 protocol_handler_submenu_model_.AddSeparator(ui::NORMAL_SEPARATOR); | 1079 protocol_handler_submenu_model_.AddSeparator(ui::NORMAL_SEPARATOR); |
1080 protocol_handler_submenu_model_.AddItem( | 1080 protocol_handler_submenu_model_.AddItem( |
1081 IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS, | 1081 IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS, |
1082 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_OPENLINKWITH_CONFIGURE)); | 1082 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_OPENLINKWITH_CONFIGURE)); |
1083 | 1083 |
1084 menu_model_.AddSubMenu( | 1084 menu_model_.AddSubMenu( |
1085 IDC_CONTENT_CONTEXT_OPENLINKWITH, | 1085 IDC_CONTENT_CONTEXT_OPENLINKWITH, |
1086 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_OPENLINKWITH), | 1086 l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_OPENLINKWITH), |
1087 &protocol_handler_submenu_model_); | 1087 &protocol_handler_submenu_model_); |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2037 source_web_contents_->GetRenderViewHost()-> | 2037 source_web_contents_->GetRenderViewHost()-> |
2038 ExecuteMediaPlayerActionAtLocation(location, action); | 2038 ExecuteMediaPlayerActionAtLocation(location, action); |
2039 } | 2039 } |
2040 | 2040 |
2041 void RenderViewContextMenu::PluginActionAt( | 2041 void RenderViewContextMenu::PluginActionAt( |
2042 const gfx::Point& location, | 2042 const gfx::Point& location, |
2043 const WebPluginAction& action) { | 2043 const WebPluginAction& action) { |
2044 source_web_contents_->GetRenderViewHost()-> | 2044 source_web_contents_->GetRenderViewHost()-> |
2045 ExecutePluginActionAtLocation(location, action); | 2045 ExecutePluginActionAtLocation(location, action); |
2046 } | 2046 } |
OLD | NEW |