| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |