| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 7 |
| 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 | 681 |
| 682 void RenderViewContextMenu::AppendSearchProvider() { | 682 void RenderViewContextMenu::AppendSearchProvider() { |
| 683 DCHECK(profile_); | 683 DCHECK(profile_); |
| 684 | 684 |
| 685 TrimWhitespace(params_.selection_text, TRIM_ALL, ¶ms_.selection_text); | 685 TrimWhitespace(params_.selection_text, TRIM_ALL, ¶ms_.selection_text); |
| 686 if (params_.selection_text.empty()) | 686 if (params_.selection_text.empty()) |
| 687 return; | 687 return; |
| 688 | 688 |
| 689 AutocompleteMatch match; | 689 AutocompleteMatch match; |
| 690 profile_->GetAutocompleteClassifier()->Classify( | 690 profile_->GetAutocompleteClassifier()->Classify( |
| 691 params_.selection_text, string16(), false, &match, NULL); | 691 params_.selection_text, string16(), false, false, &match, NULL); |
| 692 selection_navigation_url_ = match.destination_url; | 692 selection_navigation_url_ = match.destination_url; |
| 693 if (!selection_navigation_url_.is_valid()) | 693 if (!selection_navigation_url_.is_valid()) |
| 694 return; | 694 return; |
| 695 | 695 |
| 696 string16 printable_selection_text = PrintableSelectionText(); | 696 string16 printable_selection_text = PrintableSelectionText(); |
| 697 // Escape "&" as "&&". | 697 // Escape "&" as "&&". |
| 698 for (size_t i = printable_selection_text.find('&'); i != string16::npos; | 698 for (size_t i = printable_selection_text.find('&'); i != string16::npos; |
| 699 i = printable_selection_text.find('&', i + 2)) | 699 i = printable_selection_text.find('&', i + 2)) |
| 700 printable_selection_text.insert(i, 1, '&'); | 700 printable_selection_text.insert(i, 1, '&'); |
| 701 | 701 |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1613 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 1614 g_browser_process->clipboard()); | 1614 g_browser_process->clipboard()); |
| 1615 } | 1615 } |
| 1616 | 1616 |
| 1617 void RenderViewContextMenu::MediaPlayerActionAt( | 1617 void RenderViewContextMenu::MediaPlayerActionAt( |
| 1618 const gfx::Point& location, | 1618 const gfx::Point& location, |
| 1619 const WebMediaPlayerAction& action) { | 1619 const WebMediaPlayerAction& action) { |
| 1620 source_tab_contents_->render_view_host()->MediaPlayerActionAt( | 1620 source_tab_contents_->render_view_host()->MediaPlayerActionAt( |
| 1621 location, action); | 1621 location, action); |
| 1622 } | 1622 } |
| OLD | NEW |