| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 if (target_profiles_entries.size() == 1u) { | 933 if (target_profiles_entries.size() == 1u) { |
| 934 int menu_index = static_cast<int>(profile_link_paths_.size()); | 934 int menu_index = static_cast<int>(profile_link_paths_.size()); |
| 935 ProfileAttributesEntry* entry = target_profiles_entries.front(); | 935 ProfileAttributesEntry* entry = target_profiles_entries.front(); |
| 936 profile_link_paths_.push_back(entry->GetPath()); | 936 profile_link_paths_.push_back(entry->GetPath()); |
| 937 menu_model_.AddItem( | 937 menu_model_.AddItem( |
| 938 IDC_OPEN_LINK_IN_PROFILE_FIRST + menu_index, | 938 IDC_OPEN_LINK_IN_PROFILE_FIRST + menu_index, |
| 939 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_OPENLINKINPROFILE, | 939 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_OPENLINKINPROFILE, |
| 940 entry->GetName())); | 940 entry->GetName())); |
| 941 AddIconToLastMenuItem(entry->GetAvatarIcon(), &menu_model_); | 941 AddIconToLastMenuItem(entry->GetAvatarIcon(), &menu_model_); |
| 942 } else if (target_profiles_entries.size() > 1u) { | 942 } else if (target_profiles_entries.size() > 1u) { |
| 943 for (ProfileAttributesEntry* entry : entries) { | 943 for (ProfileAttributesEntry* entry : target_profiles_entries) { |
| 944 int menu_index = static_cast<int>(profile_link_paths_.size()); | 944 int menu_index = static_cast<int>(profile_link_paths_.size()); |
| 945 // In extreme cases, we might have more profiles than available | 945 // In extreme cases, we might have more profiles than available |
| 946 // command ids. In that case, just stop creating new entries - the | 946 // command ids. In that case, just stop creating new entries - the |
| 947 // menu is probably useless at this point already. | 947 // menu is probably useless at this point already. |
| 948 if (IDC_OPEN_LINK_IN_PROFILE_FIRST + menu_index > | 948 if (IDC_OPEN_LINK_IN_PROFILE_FIRST + menu_index > |
| 949 IDC_OPEN_LINK_IN_PROFILE_LAST) { | 949 IDC_OPEN_LINK_IN_PROFILE_LAST) { |
| 950 break; | 950 break; |
| 951 } | 951 } |
| 952 profile_link_paths_.push_back(entry->GetPath()); | 952 profile_link_paths_.push_back(entry->GetPath()); |
| 953 profile_link_submenu_model_.AddItem( | 953 profile_link_submenu_model_.AddItem( |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2206 source_web_contents_->GetRenderViewHost()-> | 2206 source_web_contents_->GetRenderViewHost()-> |
| 2207 ExecuteMediaPlayerActionAtLocation(location, action); | 2207 ExecuteMediaPlayerActionAtLocation(location, action); |
| 2208 } | 2208 } |
| 2209 | 2209 |
| 2210 void RenderViewContextMenu::PluginActionAt( | 2210 void RenderViewContextMenu::PluginActionAt( |
| 2211 const gfx::Point& location, | 2211 const gfx::Point& location, |
| 2212 const WebPluginAction& action) { | 2212 const WebPluginAction& action) { |
| 2213 source_web_contents_->GetRenderViewHost()-> | 2213 source_web_contents_->GetRenderViewHost()-> |
| 2214 ExecutePluginActionAtLocation(location, action); | 2214 ExecutePluginActionAtLocation(location, action); |
| 2215 } | 2215 } |
| OLD | NEW |