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/local_storage_set_item_info_view.h" | 5 #include "chrome/browser/views/local_storage_set_item_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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 29 matching lines...) Expand all Loading... | |
40 } | 40 } |
41 | 41 |
42 void LocalStorageSetItemInfoView::EnableLocalStorageDisplay(bool enabled) { | 42 void LocalStorageSetItemInfoView::EnableLocalStorageDisplay(bool enabled) { |
43 host_value_field_->SetEnabled(enabled); | 43 host_value_field_->SetEnabled(enabled); |
44 key_value_field_->SetEnabled(enabled); | 44 key_value_field_->SetEnabled(enabled); |
45 value_value_field_->SetEnabled(enabled); | 45 value_value_field_->SetEnabled(enabled); |
46 } | 46 } |
47 | 47 |
48 void LocalStorageSetItemInfoView::ClearLocalStorageDisplay() { | 48 void LocalStorageSetItemInfoView::ClearLocalStorageDisplay() { |
49 std::wstring no_cookie_string = | 49 std::wstring no_cookie_string = |
50 l10n_util::GetString(IDS_COOKIES_COOKIE_NONESELECTED); | 50 UTF16ToWide(l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_NONESELECTED)); |
51 host_value_field_->SetText(no_cookie_string); | 51 host_value_field_->SetText(no_cookie_string); |
52 key_value_field_->SetText(no_cookie_string); | 52 key_value_field_->SetText(no_cookie_string); |
53 value_value_field_->SetText(no_cookie_string); | 53 value_value_field_->SetText(no_cookie_string); |
54 EnableLocalStorageDisplay(false); | 54 EnableLocalStorageDisplay(false); |
55 } | 55 } |
56 | 56 |
57 /////////////////////////////////////////////////////////////////////////////// | 57 /////////////////////////////////////////////////////////////////////////////// |
58 // LocalStorageSetItemInfoView, views::View overrides: | 58 // LocalStorageSetItemInfoView, views::View overrides: |
59 | 59 |
60 void LocalStorageSetItemInfoView::ViewHierarchyChanged( | 60 void LocalStorageSetItemInfoView::ViewHierarchyChanged( |
61 bool is_add, views::View* parent, views::View* child) { | 61 bool is_add, views::View* parent, views::View* child) { |
62 if (is_add && child == this) | 62 if (is_add && child == this) |
63 Init(); | 63 Init(); |
64 } | 64 } |
65 | 65 |
66 /////////////////////////////////////////////////////////////////////////////// | 66 /////////////////////////////////////////////////////////////////////////////// |
67 // LocalStorageSetItemInfoView, private: | 67 // LocalStorageSetItemInfoView, private: |
68 | 68 |
69 void LocalStorageSetItemInfoView::Init() { | 69 void LocalStorageSetItemInfoView::Init() { |
70 SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW); | 70 SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW); |
71 views::Border* border = views::Border::CreateSolidBorder( | 71 views::Border* border = views::Border::CreateSolidBorder( |
72 kLocalStorageSetItemInfoViewBorderSize, border_color); | 72 kLocalStorageSetItemInfoViewBorderSize, border_color); |
73 set_border(border); | 73 set_border(border); |
74 | 74 |
75 // TODO(jorlow): These strings are not quite right, but we're post-freeze. | 75 // TODO(jorlow): These strings are not quite right, but we're post-freeze. |
76 views::Label* host_label = new views::Label( | 76 // http://crbug.com/68688 |
Evan Martin
2011/01/06 19:48:28
Nice catch!
| |
77 l10n_util::GetString(IDS_COOKIES_COOKIE_DOMAIN_LABEL)); | 77 views::Label* host_label = new views::Label(UTF16ToWide( |
78 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_DOMAIN_LABEL))); | |
78 host_value_field_ = new views::Textfield; | 79 host_value_field_ = new views::Textfield; |
79 views::Label* key_label = new views::Label( | 80 views::Label* key_label = new views::Label(UTF16ToWide( |
80 l10n_util::GetString(IDS_COOKIES_LOCAL_STORAGE_KEY_LABEL)); | 81 l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_KEY_LABEL))); |
81 key_value_field_ = new views::Textfield; | 82 key_value_field_ = new views::Textfield; |
82 views::Label* value_label = new views::Label( | 83 views::Label* value_label = new views::Label(UTF16ToWide( |
83 l10n_util::GetString(IDS_COOKIES_LOCAL_STORAGE_VALUE_LABEL)); | 84 l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_VALUE_LABEL))); |
84 value_value_field_ = new views::Textfield; | 85 value_value_field_ = new views::Textfield; |
85 | 86 |
86 using views::GridLayout; | 87 using views::GridLayout; |
87 | 88 |
88 GridLayout* layout = new GridLayout(this); | 89 GridLayout* layout = new GridLayout(this); |
89 layout->SetInsets(kLocalStorageSetItemInfoViewInsetSize, | 90 layout->SetInsets(kLocalStorageSetItemInfoViewInsetSize, |
90 kLocalStorageSetItemInfoViewInsetSize, | 91 kLocalStorageSetItemInfoViewInsetSize, |
91 kLocalStorageSetItemInfoViewInsetSize, | 92 kLocalStorageSetItemInfoViewInsetSize, |
92 kLocalStorageSetItemInfoViewInsetSize); | 93 kLocalStorageSetItemInfoViewInsetSize); |
93 SetLayoutManager(layout); | 94 SetLayoutManager(layout); |
(...skipping 24 matching lines...) Expand all Loading... | |
118 host_value_field_->SetReadOnly(true); | 119 host_value_field_->SetReadOnly(true); |
119 host_value_field_->RemoveBorder(); | 120 host_value_field_->RemoveBorder(); |
120 host_value_field_->SetBackgroundColor(text_area_background); | 121 host_value_field_->SetBackgroundColor(text_area_background); |
121 key_value_field_->SetReadOnly(true); | 122 key_value_field_->SetReadOnly(true); |
122 key_value_field_->RemoveBorder(); | 123 key_value_field_->RemoveBorder(); |
123 key_value_field_->SetBackgroundColor(text_area_background); | 124 key_value_field_->SetBackgroundColor(text_area_background); |
124 value_value_field_->SetReadOnly(true); | 125 value_value_field_->SetReadOnly(true); |
125 value_value_field_->RemoveBorder(); | 126 value_value_field_->RemoveBorder(); |
126 value_value_field_->SetBackgroundColor(text_area_background); | 127 value_value_field_->SetBackgroundColor(text_area_background); |
127 } | 128 } |
OLD | NEW |