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

Side by Side Diff: chrome/browser/ui/gtk/tabs/tab_strip_gtk.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
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 "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 const int drop_index = drop_info_->drop_index; 1624 const int drop_index = drop_info_->drop_index;
1625 const bool drop_before = drop_info_->drop_before; 1625 const bool drop_before = drop_info_->drop_before;
1626 1626
1627 // Destroy the drop indicator. 1627 // Destroy the drop indicator.
1628 drop_info_.reset(); 1628 drop_info_.reset();
1629 1629
1630 GURL url; 1630 GURL url;
1631 if (is_plain_text) { 1631 if (is_plain_text) {
1632 AutocompleteMatch match; 1632 AutocompleteMatch match;
1633 model_->profile()->GetAutocompleteClassifier()->Classify( 1633 model_->profile()->GetAutocompleteClassifier()->Classify(
1634 UTF8ToWide(reinterpret_cast<char*>(data)), std::wstring(), false, 1634 UTF8ToUTF16(reinterpret_cast<char*>(data)), string16(), false,
1635 &match, NULL); 1635 &match, NULL);
1636 url = match.destination_url; 1636 url = match.destination_url;
1637 } else { 1637 } else {
1638 std::string url_string(reinterpret_cast<char*>(data)); 1638 std::string url_string(reinterpret_cast<char*>(data));
1639 url = GURL(url_string.substr(0, url_string.find_first_of('\n'))); 1639 url = GURL(url_string.substr(0, url_string.find_first_of('\n')));
1640 } 1640 }
1641 if (!url.is_valid()) 1641 if (!url.is_valid())
1642 return false; 1642 return false;
1643 1643
1644 browser::NavigateParams params(window()->browser(), url, 1644 browser::NavigateParams params(window()->browser(), url,
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2054 2054
2055 // Let the middle mouse button initiate clicks as well. 2055 // Let the middle mouse button initiate clicks as well.
2056 gtk_util::SetButtonTriggersNavigation(button->widget()); 2056 gtk_util::SetButtonTriggersNavigation(button->widget());
2057 g_signal_connect(button->widget(), "clicked", 2057 g_signal_connect(button->widget(), "clicked",
2058 G_CALLBACK(OnNewTabClickedThunk), this); 2058 G_CALLBACK(OnNewTabClickedThunk), this);
2059 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); 2059 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS);
2060 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); 2060 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0);
2061 2061
2062 return button; 2062 return button;
2063 } 2063 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698