| OLD | NEW |
| 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/cookie_info_view.h" | 5 #include "chrome/browser/views/cookie_info_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/string16.h" |
| 12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/cookies_tree_model.h" | 15 #include "chrome/browser/cookies_tree_model.h" |
| 14 #include "chrome/browser/profile.h" | 16 #include "chrome/browser/profile.h" |
| 15 #include "gfx/canvas.h" | 17 #include "gfx/canvas.h" |
| 16 #include "gfx/color_utils.h" | 18 #include "gfx/color_utils.h" |
| 17 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 18 #include "grit/locale_settings.h" | 20 #include "grit/locale_settings.h" |
| 19 #include "views/border.h" | 21 #include "views/border.h" |
| 20 #include "views/grid_layout.h" | 22 #include "views/grid_layout.h" |
| 21 #include "views/controls/label.h" | 23 #include "views/controls/label.h" |
| 22 #include "views/controls/button/native_button.h" | 24 #include "views/controls/button/native_button.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 if (delegate_) | 144 if (delegate_) |
| 143 delegate_->ModifyExpireDate(new_index != 0); | 145 delegate_->ModifyExpireDate(new_index != 0); |
| 144 } | 146 } |
| 145 | 147 |
| 146 /////////////////////////////////////////////////////////////////////////////// | 148 /////////////////////////////////////////////////////////////////////////////// |
| 147 // CookieInfoView, ComboboxModel overrides. | 149 // CookieInfoView, ComboboxModel overrides. |
| 148 int CookieInfoView::GetItemCount() { | 150 int CookieInfoView::GetItemCount() { |
| 149 return static_cast<int>(expire_combo_values_.size()); | 151 return static_cast<int>(expire_combo_values_.size()); |
| 150 } | 152 } |
| 151 | 153 |
| 152 std::wstring CookieInfoView::GetItemAt(int index) { | 154 string16 CookieInfoView::GetItemAt(int index) { |
| 153 return expire_combo_values_[index]; | 155 return WideToUTF16Hack(expire_combo_values_[index]); |
| 154 } | 156 } |
| 155 | 157 |
| 156 void CookieInfoView::AddLabelRow(int layout_id, views::GridLayout* layout, | 158 void CookieInfoView::AddLabelRow(int layout_id, views::GridLayout* layout, |
| 157 views::View* label, views::View* value) { | 159 views::View* label, views::View* value) { |
| 158 layout->StartRow(0, layout_id); | 160 layout->StartRow(0, layout_id); |
| 159 layout->AddView(label); | 161 layout->AddView(label); |
| 160 layout->AddView(value, 2, 1, views::GridLayout::FILL, | 162 layout->AddView(value, 2, 1, views::GridLayout::FILL, |
| 161 views::GridLayout::CENTER); | 163 views::GridLayout::CENTER); |
| 162 layout->AddPaddingRow(0, kRelatedControlSmallVerticalSpacing); | 164 layout->AddPaddingRow(0, kRelatedControlSmallVerticalSpacing); |
| 163 } | 165 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 created_value_field_->SetReadOnly(true); | 269 created_value_field_->SetReadOnly(true); |
| 268 created_value_field_->RemoveBorder(); | 270 created_value_field_->RemoveBorder(); |
| 269 created_value_field_->SetBackgroundColor(text_area_background); | 271 created_value_field_->SetBackgroundColor(text_area_background); |
| 270 if (expires_value_field_) { | 272 if (expires_value_field_) { |
| 271 expires_value_field_->SetReadOnly(true); | 273 expires_value_field_->SetReadOnly(true); |
| 272 expires_value_field_->RemoveBorder(); | 274 expires_value_field_->RemoveBorder(); |
| 273 expires_value_field_->SetBackgroundColor(text_area_background); | 275 expires_value_field_->SetBackgroundColor(text_area_background); |
| 274 } | 276 } |
| 275 } | 277 } |
| 276 | 278 |
| OLD | NEW |