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

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

Issue 10536108: When the user highlights all or part of a link, don't show "Go to <URL>" if that would navigate to … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/tab_contents/render_view_context_menu.h" 9 #include "chrome/browser/tab_contents/render_view_context_menu.h"
10 10
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 if (!selection_navigation_url_.is_valid()) 910 if (!selection_navigation_url_.is_valid())
911 return; 911 return;
912 912
913 string16 printable_selection_text = PrintableSelectionText(); 913 string16 printable_selection_text = PrintableSelectionText();
914 // Escape "&" as "&&". 914 // Escape "&" as "&&".
915 for (size_t i = printable_selection_text.find('&'); i != string16::npos; 915 for (size_t i = printable_selection_text.find('&'); i != string16::npos;
916 i = printable_selection_text.find('&', i + 2)) 916 i = printable_selection_text.find('&', i + 2))
917 printable_selection_text.insert(i, 1, '&'); 917 printable_selection_text.insert(i, 1, '&');
918 918
919 if (match.transition == content::PAGE_TRANSITION_TYPED) { 919 if (match.transition == content::PAGE_TRANSITION_TYPED) {
920 if (ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( 920 if ((selection_navigation_url_ != params_.link_url) &&
tfarina 2012/06/12 17:13:58 I verified this works.
921 selection_navigation_url_.scheme())) { 921 ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme(
922 selection_navigation_url_.scheme())) {
922 menu_model_.AddItem( 923 menu_model_.AddItem(
923 IDC_CONTENT_CONTEXT_GOTOURL, 924 IDC_CONTENT_CONTEXT_GOTOURL,
924 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_GOTOURL, 925 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_GOTOURL,
925 printable_selection_text)); 926 printable_selection_text));
926 } 927 }
927 } else { 928 } else {
928 const TemplateURL* const default_provider = 929 const TemplateURL* const default_provider =
929 TemplateURLServiceFactory::GetForProfile(profile_)-> 930 TemplateURLServiceFactory::GetForProfile(profile_)->
930 GetDefaultSearchProvider(); 931 GetDefaultSearchProvider();
931 if (!default_provider) 932 if (!default_provider)
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1982 source_web_contents_->GetRenderViewHost()-> 1983 source_web_contents_->GetRenderViewHost()->
1983 ExecuteMediaPlayerActionAtLocation(location, action); 1984 ExecuteMediaPlayerActionAtLocation(location, action);
1984 } 1985 }
1985 1986
1986 void RenderViewContextMenu::PluginActionAt( 1987 void RenderViewContextMenu::PluginActionAt(
1987 const gfx::Point& location, 1988 const gfx::Point& location,
1988 const WebPluginAction& action) { 1989 const WebPluginAction& action) {
1989 source_web_contents_->GetRenderViewHost()-> 1990 source_web_contents_->GetRenderViewHost()->
1990 ExecutePluginActionAtLocation(location, action); 1991 ExecutePluginActionAtLocation(location, action);
1991 } 1992 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698