Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |