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

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

Issue 6306011: Remove wstring from autocomplete. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
Property Changes:
Deleted: svn:mergeinfo
OLDNEW
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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 585
586 void RenderViewContextMenu::AppendSearchProvider() { 586 void RenderViewContextMenu::AppendSearchProvider() {
587 DCHECK(profile_); 587 DCHECK(profile_);
588 588
589 TrimWhitespace(params_.selection_text, TRIM_ALL, &params_.selection_text); 589 TrimWhitespace(params_.selection_text, TRIM_ALL, &params_.selection_text);
590 if (params_.selection_text.empty()) 590 if (params_.selection_text.empty())
591 return; 591 return;
592 592
593 AutocompleteMatch match; 593 AutocompleteMatch match;
594 profile_->GetAutocompleteClassifier()->Classify( 594 profile_->GetAutocompleteClassifier()->Classify(
595 UTF16ToWideHack(params_.selection_text), 595 params_.selection_text, string16(), false, &match, NULL);
596 std::wstring(), false, &match, NULL);
597 selection_navigation_url_ = match.destination_url; 596 selection_navigation_url_ = match.destination_url;
598 if (!selection_navigation_url_.is_valid()) 597 if (!selection_navigation_url_.is_valid())
599 return; 598 return;
600 599
601 string16 printable_selection_text = PrintableSelectionText(); 600 string16 printable_selection_text = PrintableSelectionText();
602 // Escape "&" as "&&". 601 // Escape "&" as "&&".
603 for (size_t i = printable_selection_text.find('&'); i != string16::npos; 602 for (size_t i = printable_selection_text.find('&'); i != string16::npos;
604 i = printable_selection_text.find('&', i + 2)) 603 i = printable_selection_text.find('&', i + 2))
605 printable_selection_text.insert(i, 1, '&'); 604 printable_selection_text.insert(i, 1, '&');
606 605
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), 1476 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages),
1478 g_browser_process->clipboard()); 1477 g_browser_process->clipboard());
1479 } 1478 }
1480 1479
1481 void RenderViewContextMenu::MediaPlayerActionAt( 1480 void RenderViewContextMenu::MediaPlayerActionAt(
1482 const gfx::Point& location, 1481 const gfx::Point& location,
1483 const WebMediaPlayerAction& action) { 1482 const WebMediaPlayerAction& action) {
1484 source_tab_contents_->render_view_host()->MediaPlayerActionAt( 1483 source_tab_contents_->render_view_host()->MediaPlayerActionAt(
1485 location, action); 1484 location, action);
1486 } 1485 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698