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

Side by Side Diff: chrome/browser/views/options/cookies_view.cc

Issue 18076: request review: fix issue 2821 and 6132 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 6
7 #include "chrome/browser/views/options/cookies_view.h" 7 #include "chrome/browser/views/options/cookies_view.h"
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time_format.h" 10 #include "base/time_format.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 std::wstring CookiesTableModel::GetText(int row, int column_id) { 144 std::wstring CookiesTableModel::GetText(int row, int column_id) {
145 DCHECK(row >= 0 && row < RowCount()); 145 DCHECK(row >= 0 && row < RowCount());
146 switch (column_id) { 146 switch (column_id) {
147 case IDS_COOKIES_DOMAIN_COLUMN_HEADER: 147 case IDS_COOKIES_DOMAIN_COLUMN_HEADER:
148 { 148 {
149 // Domain cookies start with a trailing dot, but we will show this 149 // Domain cookies start with a trailing dot, but we will show this
150 // in the cookie details, show it without the dot in the list. 150 // in the cookie details, show it without the dot in the list.
151 std::string& domain = shown_cookies_.at(row)->first; 151 std::string& domain = shown_cookies_.at(row)->first;
152 std::wstring wide_domain;
152 if (!domain.empty() && domain[0] == '.') 153 if (!domain.empty() && domain[0] == '.')
153 return UTF8ToWide(domain.substr(1)); 154 wide_domain = UTF8ToWide(domain.substr(1));
154 return UTF8ToWide(domain); 155 else
156 wide_domain = UTF8ToWide(domain);
157 // Force domain to be LTR
158 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
159 l10n_util::WrapStringWithLTRFormatting(&wide_domain);
160 return wide_domain;
155 } 161 }
156 break; 162 break;
157 case IDS_COOKIES_NAME_COLUMN_HEADER: 163 case IDS_COOKIES_NAME_COLUMN_HEADER: {
158 return UTF8ToWide(shown_cookies_.at(row)->second.Name()); 164 std::wstring name = UTF8ToWide(shown_cookies_.at(row)->second.Name());
165 l10n_util::AdjustStringForLocaleDirection(name, &name);
166 return name;
159 break; 167 break;
168 }
160 } 169 }
161 NOTREACHED(); 170 NOTREACHED();
162 return L""; 171 return L"";
163 } 172 }
164 173
165 SkBitmap CookiesTableModel::GetIcon(int row) { 174 SkBitmap CookiesTableModel::GetIcon(int row) {
166 static SkBitmap* icon = ResourceBundle::GetSharedInstance().GetBitmapNamed( 175 static SkBitmap* icon = ResourceBundle::GetSharedInstance().GetBitmapNamed(
167 IDR_COOKIE_ICON); 176 IDR_COOKIE_ICON);
168 return *icon; 177 return *icon;
169 } 178 }
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 void CookiesView::ResetSearchQuery() { 784 void CookiesView::ResetSearchQuery() {
776 search_field_->SetText(EmptyWString()); 785 search_field_->SetText(EmptyWString());
777 UpdateSearchResults(); 786 UpdateSearchResults();
778 } 787 }
779 788
780 void CookiesView::UpdateForEmptyState() { 789 void CookiesView::UpdateForEmptyState() {
781 info_view_->ClearCookieDisplay(); 790 info_view_->ClearCookieDisplay();
782 remove_button_->SetEnabled(false); 791 remove_button_->SetEnabled(false);
783 remove_all_button_->SetEnabled(false); 792 remove_all_button_->SetEnabled(false);
784 } 793 }
OLDNEW
« no previous file with comments | « chrome/browser/views/keyword_editor_view.cc ('k') | chrome/browser/views/options/general_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698