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

Side by Side Diff: chrome/browser/search_engines/template_url_table_model.cc

Issue 3108027: Convert GetDisplayStringInLTRDirectionality from wstring to string16. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/search_engines/template_url_table_model.h" 5 #include "chrome/browser/search_engines/template_url_table_model.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // http://crbug.com/6726 for more information. 184 // http://crbug.com/6726 for more information.
185 base::i18n::AdjustStringForLocaleDirection(url_short_name, 185 base::i18n::AdjustStringForLocaleDirection(url_short_name,
186 &url_short_name); 186 &url_short_name);
187 return (template_url_model_->GetDefaultSearchProvider() == &url) ? 187 return (template_url_model_->GetDefaultSearchProvider() == &url) ?
188 l10n_util::GetStringF(IDS_SEARCH_ENGINES_EDITOR_DEFAULT_ENGINE, 188 l10n_util::GetStringF(IDS_SEARCH_ENGINES_EDITOR_DEFAULT_ENGINE,
189 url_short_name) : url_short_name; 189 url_short_name) : url_short_name;
190 } 190 }
191 191
192 case IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN: { 192 case IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN: {
193 // Keyword should be domain name. Force it to have LTR directionality. 193 // Keyword should be domain name. Force it to have LTR directionality.
194 std::wstring keyword(url.keyword()); 194 string16 keyword = WideToUTF16(url.keyword());
195 base::i18n::GetDisplayStringInLTRDirectionality(&keyword); 195 keyword = base::i18n::GetDisplayStringInLTRDirectionality(keyword);
196 return keyword; 196 return UTF16ToWide(keyword);
197 } 197 }
198 198
199 default: 199 default:
200 NOTREACHED(); 200 NOTREACHED();
201 return std::wstring(); 201 return std::wstring();
202 } 202 }
203 } 203 }
204 204
205 SkBitmap TemplateURLTableModel::GetIcon(int row) { 205 SkBitmap TemplateURLTableModel::GetIcon(int row) {
206 DCHECK(row >= 0 && row < RowCount()); 206 DCHECK(row >= 0 && row < RowCount());
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 void TemplateURLTableModel::FavIconAvailable(ModelEntry* entry) { 361 void TemplateURLTableModel::FavIconAvailable(ModelEntry* entry) {
362 std::vector<ModelEntry*>::iterator i = 362 std::vector<ModelEntry*>::iterator i =
363 find(entries_.begin(), entries_.end(), entry); 363 find(entries_.begin(), entries_.end(), entry);
364 DCHECK(i != entries_.end()); 364 DCHECK(i != entries_.end());
365 NotifyChanged(static_cast<int>(i - entries_.begin())); 365 NotifyChanged(static_cast<int>(i - entries_.begin()));
366 } 366 }
367 367
368 void TemplateURLTableModel::OnTemplateURLModelChanged() { 368 void TemplateURLTableModel::OnTemplateURLModelChanged() {
369 Reload(); 369 Reload();
370 } 370 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698