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

Side by Side Diff: chrome/browser/views/options/passwords_page_view.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/views/options/passwords_page_view.h" 5 #include "chrome/browser/views/options/passwords_page_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 int PasswordsTableModel::RowCount() { 66 int PasswordsTableModel::RowCount() {
67 return static_cast<int>(saved_signons_.size()); 67 return static_cast<int>(saved_signons_.size());
68 } 68 }
69 69
70 std::wstring PasswordsTableModel::GetText(int row, 70 std::wstring PasswordsTableModel::GetText(int row,
71 int col_id) { 71 int col_id) {
72 switch (col_id) { 72 switch (col_id) {
73 case IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN: { // Site. 73 case IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN: { // Site.
74 // Force URL to have LTR directionality. 74 // Force URL to have LTR directionality.
75 std::wstring url(saved_signons_[row]->display_url.display_url()); 75 std::wstring url(saved_signons_[row]->display_url.display_url());
76 base::i18n::GetDisplayStringInLTRDirectionality(&url); 76 url = UTF16ToWide(base::i18n::GetDisplayStringInLTRDirectionality(
77 WideToUTF16(url)));
77 return url; 78 return url;
78 } 79 }
79 case IDS_PASSWORDS_PAGE_VIEW_USERNAME_COLUMN: { // Username. 80 case IDS_PASSWORDS_PAGE_VIEW_USERNAME_COLUMN: { // Username.
80 std::wstring username = GetPasswordFormAt(row)->username_value; 81 std::wstring username = GetPasswordFormAt(row)->username_value;
81 base::i18n::AdjustStringForLocaleDirection(username, &username); 82 base::i18n::AdjustStringForLocaleDirection(username, &username);
82 return username; 83 return username;
83 } 84 }
84 default: 85 default:
85 NOTREACHED() << "Invalid column."; 86 NOTREACHED() << "Invalid column.";
86 return std::wstring(); 87 return std::wstring();
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 columns.back().sortable = true; 334 columns.back().sortable = true;
334 table_view_ = new views::TableView(&table_model_, columns, views::TEXT_ONLY, 335 table_view_ = new views::TableView(&table_model_, columns, views::TEXT_ONLY,
335 true, true, true); 336 true, true, true);
336 // Make the table initially sorted by host. 337 // Make the table initially sorted by host.
337 views::TableView::SortDescriptors sort; 338 views::TableView::SortDescriptors sort;
338 sort.push_back(views::TableView::SortDescriptor( 339 sort.push_back(views::TableView::SortDescriptor(
339 IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN, true)); 340 IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN, true));
340 table_view_->SetSortDescriptors(sort); 341 table_view_->SetSortDescriptors(sort);
341 table_view_->SetObserver(this); 342 table_view_->SetObserver(this);
342 } 343 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698