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/indexed_db_info_view.h" | 5 #include "chrome/browser/views/indexed_db_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" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 void IndexedDBInfoView::EnableIndexedDBDisplay(bool enabled) { | 46 void IndexedDBInfoView::EnableIndexedDBDisplay(bool enabled) { |
47 origin_value_field_->SetEnabled(enabled); | 47 origin_value_field_->SetEnabled(enabled); |
48 size_value_field_->SetEnabled(enabled); | 48 size_value_field_->SetEnabled(enabled); |
49 last_modified_value_field_->SetEnabled(enabled); | 49 last_modified_value_field_->SetEnabled(enabled); |
50 } | 50 } |
51 | 51 |
52 void IndexedDBInfoView::ClearIndexedDBDisplay() { | 52 void IndexedDBInfoView::ClearIndexedDBDisplay() { |
53 std::wstring no_cookie_string = | 53 std::wstring no_cookie_string = |
54 l10n_util::GetString(IDS_COOKIES_COOKIE_NONESELECTED); | 54 UTF16ToWide(l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_NONESELECTED)); |
55 origin_value_field_->SetText(no_cookie_string); | 55 origin_value_field_->SetText(no_cookie_string); |
56 size_value_field_->SetText(no_cookie_string); | 56 size_value_field_->SetText(no_cookie_string); |
57 last_modified_value_field_->SetText(no_cookie_string); | 57 last_modified_value_field_->SetText(no_cookie_string); |
58 EnableIndexedDBDisplay(false); | 58 EnableIndexedDBDisplay(false); |
59 } | 59 } |
60 | 60 |
61 /////////////////////////////////////////////////////////////////////////////// | 61 /////////////////////////////////////////////////////////////////////////////// |
62 // IndexedDBInfoView, views::View overrides: | 62 // IndexedDBInfoView, views::View overrides: |
63 | 63 |
64 void IndexedDBInfoView::ViewHierarchyChanged(bool is_add, | 64 void IndexedDBInfoView::ViewHierarchyChanged(bool is_add, |
65 views::View* parent, | 65 views::View* parent, |
66 views::View* child) { | 66 views::View* child) { |
67 if (is_add && child == this) | 67 if (is_add && child == this) |
68 Init(); | 68 Init(); |
69 } | 69 } |
70 | 70 |
71 /////////////////////////////////////////////////////////////////////////////// | 71 /////////////////////////////////////////////////////////////////////////////// |
72 // IndexedDBInfoView, private: | 72 // IndexedDBInfoView, private: |
73 | 73 |
74 void IndexedDBInfoView::Init() { | 74 void IndexedDBInfoView::Init() { |
75 SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW); | 75 SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW); |
76 views::Border* border = views::Border::CreateSolidBorder( | 76 views::Border* border = views::Border::CreateSolidBorder( |
77 kIndexedDBInfoViewBorderSize, border_color); | 77 kIndexedDBInfoViewBorderSize, border_color); |
78 set_border(border); | 78 set_border(border); |
79 | 79 |
80 views::Label* origin_label = new views::Label( | 80 views::Label* origin_label = new views::Label(UTF16ToWide( |
81 l10n_util::GetString(IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL)); | 81 l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL))); |
82 origin_value_field_ = new views::Textfield; | 82 origin_value_field_ = new views::Textfield; |
83 views::Label* size_label = new views::Label( | 83 views::Label* size_label = new views::Label(UTF16ToWide( |
84 l10n_util::GetString(IDS_COOKIES_LOCAL_STORAGE_SIZE_ON_DISK_LABEL)); | 84 l10n_util::GetStringUTF16(IDS_COOKIES_LOCAL_STORAGE_SIZE_ON_DISK_LABEL))); |
85 size_value_field_ = new views::Textfield; | 85 size_value_field_ = new views::Textfield; |
86 views::Label* last_modified_label = new views::Label( | 86 views::Label* last_modified_label = new views::Label(UTF16ToWide( |
87 l10n_util::GetString(IDS_COOKIES_LOCAL_STORAGE_LAST_MODIFIED_LABEL)); | 87 l10n_util::GetStringUTF16( |
| 88 IDS_COOKIES_LOCAL_STORAGE_LAST_MODIFIED_LABEL))); |
88 last_modified_value_field_ = new views::Textfield; | 89 last_modified_value_field_ = new views::Textfield; |
89 | 90 |
90 using views::GridLayout; | 91 using views::GridLayout; |
91 | 92 |
92 GridLayout* layout = new GridLayout(this); | 93 GridLayout* layout = new GridLayout(this); |
93 layout->SetInsets(kIndexedDBInfoViewInsetSize, | 94 layout->SetInsets(kIndexedDBInfoViewInsetSize, |
94 kIndexedDBInfoViewInsetSize, | 95 kIndexedDBInfoViewInsetSize, |
95 kIndexedDBInfoViewInsetSize, | 96 kIndexedDBInfoViewInsetSize, |
96 kIndexedDBInfoViewInsetSize); | 97 kIndexedDBInfoViewInsetSize); |
97 SetLayoutManager(layout); | 98 SetLayoutManager(layout); |
(...skipping 24 matching lines...) Expand all Loading... |
122 origin_value_field_->SetReadOnly(true); | 123 origin_value_field_->SetReadOnly(true); |
123 origin_value_field_->RemoveBorder(); | 124 origin_value_field_->RemoveBorder(); |
124 origin_value_field_->SetBackgroundColor(text_area_background); | 125 origin_value_field_->SetBackgroundColor(text_area_background); |
125 size_value_field_->SetReadOnly(true); | 126 size_value_field_->SetReadOnly(true); |
126 size_value_field_->RemoveBorder(); | 127 size_value_field_->RemoveBorder(); |
127 size_value_field_->SetBackgroundColor(text_area_background); | 128 size_value_field_->SetBackgroundColor(text_area_background); |
128 last_modified_value_field_->SetReadOnly(true); | 129 last_modified_value_field_->SetReadOnly(true); |
129 last_modified_value_field_->RemoveBorder(); | 130 last_modified_value_field_->RemoveBorder(); |
130 last_modified_value_field_->SetBackgroundColor(text_area_background); | 131 last_modified_value_field_->SetBackgroundColor(text_area_background); |
131 } | 132 } |
OLD | NEW |