Chromium Code Reviews| 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" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 created_label_ = new views::Label( | 142 created_label_ = new views::Label( |
| 143 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_CREATED_LABEL)); | 143 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_CREATED_LABEL)); |
| 144 created_value_field_ = new views::Textfield; | 144 created_value_field_ = new views::Textfield; |
| 145 expires_label_ = new views::Label( | 145 expires_label_ = new views::Label( |
| 146 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_EXPIRES_LABEL)); | 146 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_EXPIRES_LABEL)); |
| 147 expires_value_field_ = new views::Textfield; | 147 expires_value_field_ = new views::Textfield; |
| 148 | 148 |
| 149 views::GridLayout* layout = new views::GridLayout(this); | 149 views::GridLayout* layout = new views::GridLayout(this); |
| 150 SetLayoutManager(layout); | 150 SetLayoutManager(layout); |
| 151 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); | 151 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); |
| 152 int dialog_button_margin = | 152 const gfx::Insets button_row_insets = |
| 153 provider->GetDistanceMetric(DISTANCE_DIALOG_BUTTON_MARGIN); | 153 provider->GetInsetsMetric(views::INSETS_DIALOG_BUTTON_ROW); |
|
Peter Kasting
2017/05/18 00:00:06
I was pondering how here you use the button row in
Bret
2017/05/18 00:50:05
I tried to only used the HORIZONTAL/VERTICAL metri
Peter Kasting
2017/05/18 00:56:28
I filed https://bugs.chromium.org/p/chromium/issue
Bret
2017/05/18 01:20:30
I'll probably do it. I'll assign it to myself if I
| |
| 154 SetBorder(views::CreateEmptyBorder(0, dialog_button_margin, 0, | 154 SetBorder(views::CreateEmptyBorder(0, button_row_insets.left(), 0, |
| 155 dialog_button_margin)); | 155 button_row_insets.right())); |
| 156 | 156 |
| 157 int three_column_layout_id = 0; | 157 int three_column_layout_id = 0; |
| 158 views::ColumnSet* column_set = layout->AddColumnSet(three_column_layout_id); | 158 views::ColumnSet* column_set = layout->AddColumnSet(three_column_layout_id); |
| 159 column_set->AddColumn(provider->GetControlLabelGridAlignment(), | 159 column_set->AddColumn(provider->GetControlLabelGridAlignment(), |
| 160 views::GridLayout::CENTER, 0, | 160 views::GridLayout::CENTER, 0, |
| 161 views::GridLayout::USE_PREF, 0, 0); | 161 views::GridLayout::USE_PREF, 0, 0); |
| 162 column_set->AddPaddingColumn( | 162 column_set->AddPaddingColumn( |
| 163 0, | 163 0, |
| 164 provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); | 164 provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); |
| 165 column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, | 165 column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, |
| 166 0, views::GridLayout::USE_PREF, 0, 0); | 166 0, views::GridLayout::USE_PREF, 0, 0); |
| 167 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, | 167 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, |
| 168 1, views::GridLayout::USE_PREF, 0, 0); | 168 1, views::GridLayout::USE_PREF, 0, 0); |
| 169 | 169 |
| 170 AddLabelRow(three_column_layout_id, layout, name_label_, name_value_field_); | 170 AddLabelRow(three_column_layout_id, layout, name_label_, name_value_field_); |
| 171 AddLabelRow(three_column_layout_id, layout, content_label_, | 171 AddLabelRow(three_column_layout_id, layout, content_label_, |
| 172 content_value_field_); | 172 content_value_field_); |
| 173 AddLabelRow(three_column_layout_id, layout, domain_label_, | 173 AddLabelRow(three_column_layout_id, layout, domain_label_, |
| 174 domain_value_field_); | 174 domain_value_field_); |
| 175 AddLabelRow(three_column_layout_id, layout, path_label_, path_value_field_); | 175 AddLabelRow(three_column_layout_id, layout, path_label_, path_value_field_); |
| 176 AddLabelRow(three_column_layout_id, layout, send_for_label_, | 176 AddLabelRow(three_column_layout_id, layout, send_for_label_, |
| 177 send_for_value_field_); | 177 send_for_value_field_); |
| 178 AddLabelRow(three_column_layout_id, layout, created_label_, | 178 AddLabelRow(three_column_layout_id, layout, created_label_, |
| 179 created_value_field_); | 179 created_value_field_); |
| 180 AddLabelRow(three_column_layout_id, layout, expires_label_, | 180 AddLabelRow(three_column_layout_id, layout, expires_label_, |
| 181 expires_value_field_); | 181 expires_value_field_); |
| 182 } | 182 } |
| OLD | NEW |