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/clear_browsing_data_view.h" | 5 #include "chrome/browser/views/clear_browsing_data_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 void ClearBrowsingDataView2::SetAllowClear(bool allow) { | 76 void ClearBrowsingDataView2::SetAllowClear(bool allow) { |
77 allow_clear_ = allow; | 77 allow_clear_ = allow; |
78 UpdateControlEnabledState(); | 78 UpdateControlEnabledState(); |
79 } | 79 } |
80 | 80 |
81 void ClearBrowsingDataView2::Init() { | 81 void ClearBrowsingDataView2::Init() { |
82 throbber_ = new views::Throbber(50, true); | 82 throbber_ = new views::Throbber(50, true); |
83 throbber_->SetVisible(false); | 83 throbber_->SetVisible(false); |
84 | 84 |
85 status_label_ = new views::Label( | 85 status_label_ = new views::Label( |
86 l10n_util::GetString(IDS_CLEAR_DATA_DELETING)); | 86 UTF16ToWide(l10n_util::GetStringUTF16(IDS_CLEAR_DATA_DELETING))); |
87 status_label_->SetVisible(false); | 87 status_label_->SetVisible(false); |
88 | 88 |
89 // Regular view controls we draw by ourself. First, we add the dialog label. | 89 // Regular view controls we draw by ourself. First, we add the dialog label. |
90 delete_all_label_ = new views::Label( | 90 delete_all_label_ = new views::Label( |
91 l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_LABEL)); | 91 UTF16ToWide(l10n_util::GetStringUTF16(IDS_CLEAR_BROWSING_DATA_LABEL))); |
92 | 92 |
93 // Add all the check-boxes. | 93 // Add all the check-boxes. |
94 del_history_checkbox_ = | 94 del_history_checkbox_ = AddCheckbox( |
95 AddCheckbox(l10n_util::GetString(IDS_DEL_BROWSING_HISTORY_CHKBOX), | 95 UTF16ToWide(l10n_util::GetStringUTF16(IDS_DEL_BROWSING_HISTORY_CHKBOX)), |
96 profile_->GetPrefs()->GetBoolean(prefs::kDeleteBrowsingHistory)); | 96 profile_->GetPrefs()->GetBoolean(prefs::kDeleteBrowsingHistory)); |
97 | 97 |
98 del_downloads_checkbox_ = | 98 del_downloads_checkbox_ = AddCheckbox( |
99 AddCheckbox(l10n_util::GetString(IDS_DEL_DOWNLOAD_HISTORY_CHKBOX), | 99 UTF16ToWide(l10n_util::GetStringUTF16(IDS_DEL_DOWNLOAD_HISTORY_CHKBOX)), |
100 profile_->GetPrefs()->GetBoolean(prefs::kDeleteDownloadHistory)); | 100 profile_->GetPrefs()->GetBoolean(prefs::kDeleteDownloadHistory)); |
101 | 101 |
102 del_cache_checkbox_ = | 102 del_cache_checkbox_ = AddCheckbox( |
103 AddCheckbox(l10n_util::GetString(IDS_DEL_CACHE_CHKBOX), | 103 UTF16ToWide(l10n_util::GetStringUTF16(IDS_DEL_CACHE_CHKBOX)), |
104 profile_->GetPrefs()->GetBoolean(prefs::kDeleteCache)); | 104 profile_->GetPrefs()->GetBoolean(prefs::kDeleteCache)); |
105 | 105 |
106 del_cookies_checkbox_ = | 106 del_cookies_checkbox_ = AddCheckbox( |
107 AddCheckbox(l10n_util::GetString(IDS_DEL_COOKIES_CHKBOX), | 107 UTF16ToWide(l10n_util::GetStringUTF16(IDS_DEL_COOKIES_CHKBOX)), |
108 profile_->GetPrefs()->GetBoolean(prefs::kDeleteCookies)); | 108 profile_->GetPrefs()->GetBoolean(prefs::kDeleteCookies)); |
109 | 109 |
110 del_passwords_checkbox_ = | 110 del_passwords_checkbox_ = AddCheckbox( |
111 AddCheckbox(l10n_util::GetString(IDS_DEL_PASSWORDS_CHKBOX), | 111 UTF16ToWide(l10n_util::GetStringUTF16(IDS_DEL_PASSWORDS_CHKBOX)), |
112 profile_->GetPrefs()->GetBoolean(prefs::kDeletePasswords)); | 112 profile_->GetPrefs()->GetBoolean(prefs::kDeletePasswords)); |
113 | 113 |
114 del_form_data_checkbox_ = | 114 del_form_data_checkbox_ = AddCheckbox( |
115 AddCheckbox(l10n_util::GetString(IDS_DEL_FORM_DATA_CHKBOX), | 115 UTF16ToWide(l10n_util::GetStringUTF16(IDS_DEL_FORM_DATA_CHKBOX)), |
116 profile_->GetPrefs()->GetBoolean(prefs::kDeleteFormData)); | 116 profile_->GetPrefs()->GetBoolean(prefs::kDeleteFormData)); |
117 | 117 |
118 clear_browsing_data_button_ = new views::NativeButton( | 118 clear_browsing_data_button_ = new views::NativeButton( |
119 this, l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_BUTTON)); | 119 this, |
| 120 UTF16ToWide(l10n_util::GetStringUTF16(IDS_CLEAR_BROWSING_DATA_BUTTON))); |
120 | 121 |
121 // Add a label which appears before the combo box for the time period. | 122 // Add a label which appears before the combo box for the time period. |
122 time_period_label_ = new views::Label( | 123 time_period_label_ = new views::Label(UTF16ToWide( |
123 l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_TIME_LABEL)); | 124 l10n_util::GetStringUTF16(IDS_CLEAR_BROWSING_DATA_TIME_LABEL))); |
124 | 125 |
125 // Add the combo box showing how far back in time we want to delete. | 126 // Add the combo box showing how far back in time we want to delete. |
126 time_period_combobox_ = new views::Combobox(this); | 127 time_period_combobox_ = new views::Combobox(this); |
127 time_period_combobox_->SetSelectedItem(profile_->GetPrefs()->GetInteger( | 128 time_period_combobox_->SetSelectedItem(profile_->GetPrefs()->GetInteger( |
128 prefs::kDeleteTimePeriod)); | 129 prefs::kDeleteTimePeriod)); |
129 time_period_combobox_->set_listener(this); | 130 time_period_combobox_->set_listener(this); |
130 time_period_combobox_->SetAccessibleName(time_period_label_->GetText()); | 131 time_period_combobox_->SetAccessibleName(time_period_label_->GetText()); |
131 | 132 |
132 // Create the throbber and related views. The throbber and status link are | 133 // Create the throbber and related views. The throbber and status link are |
133 // contained in throbber_view_, which is positioned by DialogClientView right | 134 // contained in throbber_view_, which is positioned by DialogClientView right |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 remover_ = new BrowsingDataRemover(profile_, | 363 remover_ = new BrowsingDataRemover(profile_, |
363 static_cast<BrowsingDataRemover::TimePeriod>(period_selected), | 364 static_cast<BrowsingDataRemover::TimePeriod>(period_selected), |
364 base::Time()); | 365 base::Time()); |
365 remover_->AddObserver(this); | 366 remover_->AddObserver(this); |
366 remover_->Remove(remove_mask); | 367 remover_->Remove(remove_mask); |
367 } | 368 } |
368 | 369 |
369 void ClearBrowsingDataView2::OnBrowsingDataRemoverDone() { | 370 void ClearBrowsingDataView2::OnBrowsingDataRemoverDone() { |
370 clear_data_parent_window_->StopClearingBrowsingData(); | 371 clear_data_parent_window_->StopClearingBrowsingData(); |
371 } | 372 } |
OLD | NEW |