| 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/database_info_view.h" | 5 #include "chrome/browser/views/database_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 17 matching lines...) Expand all Loading... |
| 28 size_value_field_(NULL), | 28 size_value_field_(NULL), |
| 29 last_modified_value_field_(NULL) { | 29 last_modified_value_field_(NULL) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 DatabaseInfoView::~DatabaseInfoView() { | 32 DatabaseInfoView::~DatabaseInfoView() { |
| 33 } | 33 } |
| 34 | 34 |
| 35 void DatabaseInfoView::SetDatabaseInfo( | 35 void DatabaseInfoView::SetDatabaseInfo( |
| 36 const BrowsingDataDatabaseHelper::DatabaseInfo& database_info) { | 36 const BrowsingDataDatabaseHelper::DatabaseInfo& database_info) { |
| 37 name_value_field_->SetText(database_info.database_name.empty() ? | 37 name_value_field_->SetText(database_info.database_name.empty() ? |
| 38 l10n_util::GetString(IDS_COOKIES_WEB_DATABASE_UNNAMED_NAME) : | 38 UTF16ToWide( |
| 39 l10n_util::GetStringUTF16(IDS_COOKIES_WEB_DATABASE_UNNAMED_NAME)) : |
| 39 UTF8ToWide(database_info.database_name)); | 40 UTF8ToWide(database_info.database_name)); |
| 40 description_value_field_->SetText(UTF8ToWide(database_info.description)); | 41 description_value_field_->SetText(UTF8ToWide(database_info.description)); |
| 41 size_value_field_->SetText( | 42 size_value_field_->SetText( |
| 42 FormatBytes(database_info.size, | 43 FormatBytes(database_info.size, |
| 43 GetByteDisplayUnits(database_info.size), | 44 GetByteDisplayUnits(database_info.size), |
| 44 true)); | 45 true)); |
| 45 last_modified_value_field_->SetText( | 46 last_modified_value_field_->SetText( |
| 46 base::TimeFormatFriendlyDateAndTime(database_info.last_modified)); | 47 base::TimeFormatFriendlyDateAndTime(database_info.last_modified)); |
| 47 EnableDatabaseDisplay(true); | 48 EnableDatabaseDisplay(true); |
| 48 } | 49 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 75 /////////////////////////////////////////////////////////////////////////////// | 76 /////////////////////////////////////////////////////////////////////////////// |
| 76 // DatabaseInfoView, private: | 77 // DatabaseInfoView, private: |
| 77 | 78 |
| 78 void DatabaseInfoView::Init() { | 79 void DatabaseInfoView::Init() { |
| 79 SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW); | 80 SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW); |
| 80 views::Border* border = views::Border::CreateSolidBorder( | 81 views::Border* border = views::Border::CreateSolidBorder( |
| 81 kDatabaseInfoViewBorderSize, border_color); | 82 kDatabaseInfoViewBorderSize, border_color); |
| 82 set_border(border); | 83 set_border(border); |
| 83 | 84 |
| 84 views::Label* name_label = new views::Label( | 85 views::Label* name_label = new views::Label( |
| 85 l10n_util::GetString(IDS_COOKIES_COOKIE_NAME_LABEL)); | 86 UTF16ToWide(l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_NAME_LABEL))); |
| 86 name_value_field_ = new views::Textfield; | 87 name_value_field_ = new views::Textfield; |
| 87 views::Label* description_label = new views::Label( | 88 views::Label* description_label = new views::Label( |
| 88 l10n_util::GetString(IDS_COOKIES_WEB_DATABASE_DESCRIPTION_LABEL)); | 89 UTF16ToWide(l10n_util::GetStringUTF16( |
| 90 IDS_COOKIES_WEB_DATABASE_DESCRIPTION_LABEL))); |
| 89 description_value_field_ = new views::Textfield; | 91 description_value_field_ = new views::Textfield; |
| 90 views::Label* size_label = new views::Label( | 92 views::Label* size_label = new views::Label( |
| 91 l10n_util::GetString(IDS_COOKIES_LOCAL_STORAGE_SIZE_ON_DISK_LABEL)); | 93 UTF16ToWide(l10n_util::GetStringUTF16( |
| 94 IDS_COOKIES_LOCAL_STORAGE_SIZE_ON_DISK_LABEL))); |
| 92 size_value_field_ = new views::Textfield; | 95 size_value_field_ = new views::Textfield; |
| 93 views::Label* last_modified_label = new views::Label( | 96 views::Label* last_modified_label = new views::Label( |
| 94 l10n_util::GetString(IDS_COOKIES_LOCAL_STORAGE_LAST_MODIFIED_LABEL)); | 97 UTF16ToWide(l10n_util::GetStringUTF16( |
| 98 IDS_COOKIES_LOCAL_STORAGE_LAST_MODIFIED_LABEL))); |
| 95 last_modified_value_field_ = new views::Textfield; | 99 last_modified_value_field_ = new views::Textfield; |
| 96 | 100 |
| 97 using views::GridLayout; | 101 using views::GridLayout; |
| 98 | 102 |
| 99 GridLayout* layout = new GridLayout(this); | 103 GridLayout* layout = new GridLayout(this); |
| 100 layout->SetInsets(kDatabaseInfoViewInsetSize, | 104 layout->SetInsets(kDatabaseInfoViewInsetSize, |
| 101 kDatabaseInfoViewInsetSize, | 105 kDatabaseInfoViewInsetSize, |
| 102 kDatabaseInfoViewInsetSize, | 106 kDatabaseInfoViewInsetSize, |
| 103 kDatabaseInfoViewInsetSize); | 107 kDatabaseInfoViewInsetSize); |
| 104 SetLayoutManager(layout); | 108 SetLayoutManager(layout); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 135 description_value_field_->SetReadOnly(true); | 139 description_value_field_->SetReadOnly(true); |
| 136 description_value_field_->RemoveBorder(); | 140 description_value_field_->RemoveBorder(); |
| 137 description_value_field_->SetBackgroundColor(text_area_background); | 141 description_value_field_->SetBackgroundColor(text_area_background); |
| 138 size_value_field_->SetReadOnly(true); | 142 size_value_field_->SetReadOnly(true); |
| 139 size_value_field_->RemoveBorder(); | 143 size_value_field_->RemoveBorder(); |
| 140 size_value_field_->SetBackgroundColor(text_area_background); | 144 size_value_field_->SetBackgroundColor(text_area_background); |
| 141 last_modified_value_field_->SetReadOnly(true); | 145 last_modified_value_field_->SetReadOnly(true); |
| 142 last_modified_value_field_->RemoveBorder(); | 146 last_modified_value_field_->RemoveBorder(); |
| 143 last_modified_value_field_->SetBackgroundColor(text_area_background); | 147 last_modified_value_field_->SetBackgroundColor(text_area_background); |
| 144 } | 148 } |
| OLD | NEW |