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

Unified Diff: chrome/browser/ui/gtk/location_bar_view_gtk.cc

Issue 6256010: Revert 72380 - Remove wstring from autocomplete.... (Closed) Base URL: svn://svn.chromium.org/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.h ('k') | chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/location_bar_view_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/location_bar_view_gtk.cc (revision 72383)
+++ chrome/browser/ui/gtk/location_bar_view_gtk.cc (working copy)
@@ -459,7 +459,7 @@
}
bool LocationBarViewGtk::OnCommitSuggestedText(
- const string16& typed_text) {
+ const std::wstring& typed_text) {
return browser_->instant() && location_entry_->CommitInstantSuggestion();
}
@@ -513,7 +513,7 @@
void LocationBarViewGtk::OnChanged() {
UpdateSiteTypeArea();
- const string16 keyword(location_entry_->model()->keyword());
+ const std::wstring keyword(location_entry_->model()->keyword());
const bool is_keyword_hint = location_entry_->model()->is_keyword_hint();
show_selected_keyword_ = !keyword.empty() && !is_keyword_hint;
show_keyword_hint_ = !keyword.empty() && is_keyword_hint;
@@ -534,17 +534,17 @@
instant->Update(
browser_->GetSelectedTabContentsWrapper(),
location_entry_->model()->CurrentMatch(),
- location_entry_->GetText(),
+ WideToUTF16(location_entry_->GetText()),
location_entry_->model()->UseVerbatimInstant(),
&suggested_text);
if (!instant->MightSupportInstant()) {
- location_entry_->model()->FinalizeInstantQuery(string16(),
- string16());
+ location_entry_->model()->FinalizeInstantQuery(std::wstring(),
+ std::wstring());
}
} else {
instant->DestroyPreviewContents();
- location_entry_->model()->FinalizeInstantQuery(string16(),
- string16());
+ location_entry_->model()->FinalizeInstantQuery(std::wstring(),
+ std::wstring());
}
}
@@ -606,8 +606,8 @@
return GetTabContents()->GetFavIcon();
}
-string16 LocationBarViewGtk::GetTitle() const {
- return GetTabContents()->GetTitle();
+std::wstring LocationBarViewGtk::GetTitle() const {
+ return UTF16ToWideHack(GetTabContents()->GetTitle());
}
void LocationBarViewGtk::ShowFirstRunBubble(FirstRun::BubbleType bubble_type) {
@@ -627,7 +627,8 @@
// text.
if (!text.empty()) {
location_entry_->model()->FinalizeInstantQuery(
- location_entry_->GetText(), text);
+ location_entry_->GetText(),
+ UTF16ToWide(text));
}
} else {
location_entry_->SetInstantSuggestion(text);
@@ -970,7 +971,7 @@
pango_font_metrics_unref(metrics);
}
-void LocationBarViewGtk::SetKeywordLabel(const string16& keyword) {
+void LocationBarViewGtk::SetKeywordLabel(const std::wstring& keyword) {
if (keyword.empty())
return;
@@ -980,7 +981,7 @@
bool is_extension_keyword;
const string16 short_name = profile_->GetTemplateURLModel()->
- GetKeywordShortName(keyword, &is_extension_keyword);
+ GetKeywordShortName(WideToUTF16Hack(keyword), &is_extension_keyword);
int message_id = is_extension_keyword ?
IDS_OMNIBOX_EXTENSION_KEYWORD_TEXT : IDS_OMNIBOX_KEYWORD_TEXT;
string16 full_name = l10n_util::GetStringFUTF16(message_id,
@@ -999,7 +1000,8 @@
if (is_extension_keyword) {
const TemplateURL* template_url =
- profile_->GetTemplateURLModel()->GetTemplateURLForKeyword(keyword);
+ profile_->GetTemplateURLModel()->GetTemplateURLForKeyword(
+ WideToUTF16Hack(keyword));
const SkBitmap& bitmap = profile_->GetExtensionService()->
GetOmniboxIcon(template_url->GetExtensionId());
GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap);
@@ -1013,7 +1015,7 @@
}
}
-void LocationBarViewGtk::SetKeywordHintLabel(const string16& keyword) {
+void LocationBarViewGtk::SetKeywordHintLabel(const std::wstring& keyword) {
if (keyword.empty())
return;
@@ -1023,7 +1025,7 @@
bool is_extension_keyword;
const string16 short_name = profile_->GetTemplateURLModel()->
- GetKeywordShortName(keyword, &is_extension_keyword);
+ GetKeywordShortName(WideToUTF16Hack(keyword), &is_extension_keyword);
int message_id = is_extension_keyword ?
IDS_OMNIBOX_EXTENSION_KEYWORD_HINT : IDS_OMNIBOX_KEYWORD_HINT;
std::vector<size_t> content_param_offsets;
@@ -1127,7 +1129,7 @@
if (!pixbuf)
return;
drag_icon_ = bookmark_utils::GetDragRepresentation(pixbuf,
- GetTitle(), theme_provider_);
+ WideToUTF16(GetTitle()), theme_provider_);
g_object_unref(pixbuf);
gtk_drag_set_icon_widget(context, drag_icon_, 0, 0);
}
Property changes on: chrome/browser/ui/gtk/location_bar_view_gtk.cc
___________________________________________________________________
Added: svn:mergeinfo
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.h ('k') | chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698