| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/cookie_info_view.h" | 5 #include "chrome/browser/ui/views/cookie_info_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "chrome/browser/browsing_data/cookies_tree_model.h" | 14 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 15 #include "chrome/browser/ui/views/harmony/layout_delegate.h" |
| 15 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
| 16 #include "net/cookies/canonical_cookie.h" | 17 #include "net/cookies/canonical_cookie.h" |
| 17 #include "third_party/skia/include/core/SkColor.h" | 18 #include "third_party/skia/include/core/SkColor.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 19 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
| 20 #include "ui/native_theme/native_theme.h" | 21 #include "ui/native_theme/native_theme.h" |
| 21 #include "ui/views/border.h" | 22 #include "ui/views/border.h" |
| 22 #include "ui/views/controls/label.h" | 23 #include "ui/views/controls/label.h" |
| 23 #include "ui/views/controls/textfield/textfield.h" | 24 #include "ui/views/controls/textfield/textfield.h" |
| 24 #include "ui/views/layout/grid_layout.h" | 25 #include "ui/views/layout/grid_layout.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_EXPIRES_LABEL)); | 147 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_EXPIRES_LABEL)); |
| 147 expires_value_field_ = new views::Textfield; | 148 expires_value_field_ = new views::Textfield; |
| 148 | 149 |
| 149 views::GridLayout* layout = new views::GridLayout(this); | 150 views::GridLayout* layout = new views::GridLayout(this); |
| 150 layout->SetInsets(0, views::kButtonHEdgeMarginNew, | 151 layout->SetInsets(0, views::kButtonHEdgeMarginNew, |
| 151 0, views::kButtonHEdgeMarginNew); | 152 0, views::kButtonHEdgeMarginNew); |
| 152 SetLayoutManager(layout); | 153 SetLayoutManager(layout); |
| 153 | 154 |
| 154 int three_column_layout_id = 0; | 155 int three_column_layout_id = 0; |
| 155 views::ColumnSet* column_set = layout->AddColumnSet(three_column_layout_id); | 156 views::ColumnSet* column_set = layout->AddColumnSet(three_column_layout_id); |
| 156 column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, | 157 column_set->AddColumn(LayoutDelegate::Get()->GetControlLabelGridAlignment(), |
| 157 0, views::GridLayout::USE_PREF, 0, 0); | 158 views::GridLayout::CENTER, 0, |
| 159 views::GridLayout::USE_PREF, 0, 0); |
| 158 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); | 160 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); |
| 159 column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, | 161 column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, |
| 160 0, views::GridLayout::USE_PREF, 0, 0); | 162 0, views::GridLayout::USE_PREF, 0, 0); |
| 161 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, | 163 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, |
| 162 1, views::GridLayout::USE_PREF, 0, 0); | 164 1, views::GridLayout::USE_PREF, 0, 0); |
| 163 | 165 |
| 164 AddLabelRow(three_column_layout_id, layout, name_label_, name_value_field_); | 166 AddLabelRow(three_column_layout_id, layout, name_label_, name_value_field_); |
| 165 AddLabelRow(three_column_layout_id, layout, content_label_, | 167 AddLabelRow(three_column_layout_id, layout, content_label_, |
| 166 content_value_field_); | 168 content_value_field_); |
| 167 AddLabelRow(three_column_layout_id, layout, domain_label_, | 169 AddLabelRow(three_column_layout_id, layout, domain_label_, |
| 168 domain_value_field_); | 170 domain_value_field_); |
| 169 AddLabelRow(three_column_layout_id, layout, path_label_, path_value_field_); | 171 AddLabelRow(three_column_layout_id, layout, path_label_, path_value_field_); |
| 170 AddLabelRow(three_column_layout_id, layout, send_for_label_, | 172 AddLabelRow(three_column_layout_id, layout, send_for_label_, |
| 171 send_for_value_field_); | 173 send_for_value_field_); |
| 172 AddLabelRow(three_column_layout_id, layout, created_label_, | 174 AddLabelRow(three_column_layout_id, layout, created_label_, |
| 173 created_value_field_); | 175 created_value_field_); |
| 174 AddLabelRow(three_column_layout_id, layout, expires_label_, | 176 AddLabelRow(three_column_layout_id, layout, expires_label_, |
| 175 expires_value_field_); | 177 expires_value_field_); |
| 176 } | 178 } |
| OLD | NEW |