| 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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 if (profile_->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && | 998 if (profile_->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && |
| 999 (params_.media_type == WebContextMenuData::MediaTypeNone || | 999 (params_.media_type == WebContextMenuData::MediaTypeNone || |
| 1000 params_.media_flags & WebContextMenuData::MediaCanPrint)) { | 1000 params_.media_flags & WebContextMenuData::MediaCanPrint)) { |
| 1001 menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT); | 1001 menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT); |
| 1002 } | 1002 } |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 void RenderViewContextMenu::AppendSearchProvider() { | 1005 void RenderViewContextMenu::AppendSearchProvider() { |
| 1006 DCHECK(profile_); | 1006 DCHECK(profile_); |
| 1007 | 1007 |
| 1008 TrimWhitespace(params_.selection_text, TRIM_ALL, ¶ms_.selection_text); | 1008 base::TrimWhitespace(params_.selection_text, base::TRIM_ALL, |
| 1009 ¶ms_.selection_text); |
| 1009 if (params_.selection_text.empty()) | 1010 if (params_.selection_text.empty()) |
| 1010 return; | 1011 return; |
| 1011 | 1012 |
| 1012 base::ReplaceChars(params_.selection_text, AutocompleteMatch::kInvalidChars, | 1013 base::ReplaceChars(params_.selection_text, AutocompleteMatch::kInvalidChars, |
| 1013 base::ASCIIToUTF16(" "), ¶ms_.selection_text); | 1014 base::ASCIIToUTF16(" "), ¶ms_.selection_text); |
| 1014 | 1015 |
| 1015 AutocompleteMatch match; | 1016 AutocompleteMatch match; |
| 1016 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify( | 1017 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify( |
| 1017 params_.selection_text, false, false, AutocompleteInput::INVALID_SPEC, | 1018 params_.selection_text, false, false, AutocompleteInput::INVALID_SPEC, |
| 1018 &match, NULL); | 1019 &match, NULL); |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2111 source_web_contents_->GetRenderViewHost()-> | 2112 source_web_contents_->GetRenderViewHost()-> |
| 2112 ExecuteMediaPlayerActionAtLocation(location, action); | 2113 ExecuteMediaPlayerActionAtLocation(location, action); |
| 2113 } | 2114 } |
| 2114 | 2115 |
| 2115 void RenderViewContextMenu::PluginActionAt( | 2116 void RenderViewContextMenu::PluginActionAt( |
| 2116 const gfx::Point& location, | 2117 const gfx::Point& location, |
| 2117 const WebPluginAction& action) { | 2118 const WebPluginAction& action) { |
| 2118 source_web_contents_->GetRenderViewHost()-> | 2119 source_web_contents_->GetRenderViewHost()-> |
| 2119 ExecutePluginActionAtLocation(location, action); | 2120 ExecutePluginActionAtLocation(location, action); |
| 2120 } | 2121 } |
| OLD | NEW |