Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 1754393002: Fix current profile is unnecessary added to "Open link as" context menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix implicit conversion of signed and unsigned integers Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698