OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 10 #include "base/message_loop.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "chrome/browser/cookies_tree_model.h" | 14 #include "chrome/browser/cookies_tree_model.h" |
15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
16 #include "grit/locale_settings.h" | 16 #include "grit/locale_settings.h" |
17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
18 #include "ui/gfx/canvas.h" | 18 #include "ui/gfx/canvas.h" |
19 #include "ui/gfx/color_utils.h" | 19 #include "ui/gfx/color_utils.h" |
20 #include "ui/views/layout/grid_layout.h" | 20 #include "ui/views/layout/grid_layout.h" |
21 #include "ui/views/layout/layout_constants.h" | 21 #include "ui/views/layout/layout_constants.h" |
22 #include "views/border.h" | 22 #include "views/border.h" |
| 23 #include "views/controls/combobox/combobox.h" |
23 #include "views/controls/label.h" | 24 #include "views/controls/label.h" |
24 #include "views/controls/textfield/textfield.h" | 25 #include "views/controls/textfield/textfield.h" |
25 #include "views/controls/tree/tree_view.h" | 26 #include "views/controls/tree/tree_view.h" |
26 | 27 |
27 static const int kCookieInfoViewBorderSize = 1; | 28 static const int kCookieInfoViewBorderSize = 1; |
28 static const int kCookieInfoViewInsetSize = 3; | 29 static const int kCookieInfoViewInsetSize = 3; |
29 | 30 |
30 /////////////////////////////////////////////////////////////////////////////// | 31 /////////////////////////////////////////////////////////////////////////////// |
31 // CookieInfoView, public: | 32 // CookieInfoView, public: |
32 | 33 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // CookieInfoView, views::View overrides. | 130 // CookieInfoView, views::View overrides. |
130 | 131 |
131 void CookieInfoView::ViewHierarchyChanged(bool is_add, | 132 void CookieInfoView::ViewHierarchyChanged(bool is_add, |
132 views::View* parent, | 133 views::View* parent, |
133 views::View* child) { | 134 views::View* child) { |
134 if (is_add && child == this) | 135 if (is_add && child == this) |
135 Init(); | 136 Init(); |
136 } | 137 } |
137 | 138 |
138 /////////////////////////////////////////////////////////////////////////////// | 139 /////////////////////////////////////////////////////////////////////////////// |
139 // CookieInfoView, views::Combobox::Listener overrides. | 140 // CookieInfoView, views::ComboboxListener overrides. |
140 | 141 |
141 void CookieInfoView::ItemChanged(views::Combobox* combo_box, | 142 void CookieInfoView::ItemChanged(views::Combobox* combo_box, |
142 int prev_index, | 143 int prev_index, |
143 int new_index) { | 144 int new_index) { |
144 DCHECK(combo_box == expires_value_combobox_); | 145 DCHECK(combo_box == expires_value_combobox_); |
145 if (delegate_) | 146 if (delegate_) |
146 delegate_->ModifyExpireDate(new_index != 0); | 147 delegate_->ModifyExpireDate(new_index != 0); |
147 } | 148 } |
148 | 149 |
149 /////////////////////////////////////////////////////////////////////////////// | 150 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 send_for_value_field_->SetBackgroundColor(text_area_background); | 270 send_for_value_field_->SetBackgroundColor(text_area_background); |
270 created_value_field_->SetReadOnly(true); | 271 created_value_field_->SetReadOnly(true); |
271 created_value_field_->RemoveBorder(); | 272 created_value_field_->RemoveBorder(); |
272 created_value_field_->SetBackgroundColor(text_area_background); | 273 created_value_field_->SetBackgroundColor(text_area_background); |
273 if (expires_value_field_) { | 274 if (expires_value_field_) { |
274 expires_value_field_->SetReadOnly(true); | 275 expires_value_field_->SetReadOnly(true); |
275 expires_value_field_->RemoveBorder(); | 276 expires_value_field_->RemoveBorder(); |
276 expires_value_field_->SetBackgroundColor(text_area_background); | 277 expires_value_field_->SetBackgroundColor(text_area_background); |
277 } | 278 } |
278 } | 279 } |
OLD | NEW |