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.h" | 5 #include "chrome/browser/views/clear_browsing_data.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_process.h" |
10 #include "chrome/browser/browser_window.h" | 11 #include "chrome/browser/browser_window.h" |
11 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/search_engines/template_url_model.h" | 14 #include "chrome/browser/search_engines/template_url_model.h" |
14 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
15 #if defined(OS_WIN) | 16 #include "chrome/common/notification_details.h" |
16 #include "chrome/browser/views/clear_browsing_data_view.h" | |
17 #endif | |
18 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
19 #include "gfx/insets.h" | 18 #include "gfx/insets.h" |
20 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
21 #include "grit/locale_settings.h" | 20 #include "grit/locale_settings.h" |
22 #include "net/url_request/url_request_context.h" | 21 #include "net/url_request/url_request_context.h" |
23 #include "views/background.h" | 22 #include "views/background.h" |
24 #include "views/controls/button/checkbox.h" | 23 #include "views/controls/button/checkbox.h" |
25 #include "views/controls/label.h" | 24 #include "views/controls/label.h" |
26 #include "views/controls/separator.h" | 25 #include "views/controls/separator.h" |
27 #include "views/controls/throbber.h" | 26 #include "views/controls/throbber.h" |
28 #include "views/grid_layout.h" | 27 #include "views/grid_layout.h" |
29 #include "views/standard_layout.h" | 28 #include "views/standard_layout.h" |
30 #include "views/widget/widget.h" | 29 #include "views/widget/widget.h" |
31 #include "views/window/dialog_client_view.h" | 30 #include "views/window/dialog_client_view.h" |
32 #include "views/window/window.h" | 31 #include "views/window/window.h" |
33 | 32 |
| 33 #if defined(OS_WIN) |
| 34 #include "chrome/browser/views/clear_browsing_data_view.h" |
| 35 #endif |
| 36 |
34 using views::GridLayout; | 37 using views::GridLayout; |
35 | 38 |
36 // The combo box is vertically aligned to the 'time-period' label, which makes | 39 // The combo box is vertically aligned to the 'time-period' label, which makes |
37 // the combo box look a little too close to the check box above it when we use | 40 // the combo box look a little too close to the check box above it when we use |
38 // standard layout to separate them. We therefore add a little extra margin to | 41 // standard layout to separate them. We therefore add a little extra margin to |
39 // the label, giving it a little breathing space. | 42 // the label, giving it a little breathing space. |
40 static const int kExtraMarginForTimePeriodLabel = 3; | 43 static const int kExtraMarginForTimePeriodLabel = 3; |
41 | 44 |
42 namespace browser { | 45 namespace browser { |
43 // Defined in browser_dialogs.h for creation of the view. | 46 // Defined in browser_dialogs.h for creation of the view. |
44 void ShowClearBrowsingDataView(gfx::NativeWindow parent, | 47 void ShowClearBrowsingDataView(gfx::NativeWindow parent, |
45 Profile* profile) { | 48 Profile* profile) { |
46 | 49 |
47 views::Window::CreateChromeWindow(parent, gfx::Rect(), | 50 views::Window::CreateChromeWindow(parent, gfx::Rect(), |
48 new ClearBrowsingDataView(profile))->Show(); | 51 new ClearBrowsingDataView(profile))->Show(); |
49 } | 52 } |
50 | 53 |
51 } // namespace browser | 54 } // namespace browser |
52 | 55 |
53 | 56 |
54 //////////////////////////////////////////////////////////////////////////////// | 57 //////////////////////////////////////////////////////////////////////////////// |
55 // ClearBrowsingDataView, public: | 58 // ClearBrowsingDataView, public: |
56 | 59 |
57 ClearBrowsingDataView::ClearBrowsingDataView(Profile* profile) | 60 ClearBrowsingDataView::ClearBrowsingDataView(Profile* profile) |
58 : del_history_checkbox_(NULL), | 61 : del_history_checkbox_(NULL), |
59 del_downloads_checkbox_(NULL), | 62 del_downloads_checkbox_(NULL), |
60 del_cache_checkbox_(NULL), | 63 del_cache_checkbox_(NULL), |
61 del_cookies_checkbox_(NULL), | 64 del_cookies_checkbox_(NULL), |
62 del_passwords_checkbox_(NULL), | 65 del_passwords_checkbox_(NULL), |
| 66 del_lso_data_checkbox_(NULL), |
63 del_form_data_checkbox_(NULL), | 67 del_form_data_checkbox_(NULL), |
64 time_period_label_(NULL), | 68 time_period_label_(NULL), |
65 time_period_combobox_(NULL), | 69 time_period_combobox_(NULL), |
66 delete_in_progress_(false), | 70 delete_in_progress_(false), |
67 profile_(profile), | 71 profile_(profile), |
68 remover_(NULL) { | 72 remover_(NULL) { |
69 DCHECK(profile); | 73 DCHECK(profile); |
70 Init(); | 74 Init(); |
71 } | 75 } |
72 | 76 |
73 ClearBrowsingDataView::~ClearBrowsingDataView(void) { | 77 ClearBrowsingDataView::~ClearBrowsingDataView(void) { |
74 if (remover_) { | 78 if (remover_) { |
75 // We were destroyed while clearing history was in progress. This can only | 79 // We were destroyed while clearing history was in progress. This can only |
76 // occur during automated tests (normally the user can't close the dialog | 80 // occur during automated tests (normally the user can't close the dialog |
77 // while clearing is in progress as the dialog is modal and not closeable). | 81 // while clearing is in progress as the dialog is modal and not closeable). |
78 remover_->RemoveObserver(this); | 82 remover_->RemoveObserver(this); |
79 } | 83 } |
80 } | 84 } |
81 | 85 |
82 void ClearBrowsingDataView::Init() { | 86 void ClearBrowsingDataView::Init() { |
| 87 del_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled, |
| 88 g_browser_process->local_state(), |
| 89 this); |
| 90 |
83 // Views we will add to the *parent* of this dialog, since it will display | 91 // Views we will add to the *parent* of this dialog, since it will display |
84 // next to the buttons which we don't draw ourselves. | 92 // next to the buttons which we don't draw ourselves. |
85 throbber_ = new views::Throbber(50, true); | 93 throbber_ = new views::Throbber(50, true); |
86 throbber_->SetVisible(false); | 94 throbber_->SetVisible(false); |
87 | 95 |
88 status_label_ = new views::Label( | 96 status_label_ = new views::Label( |
89 l10n_util::GetString(IDS_CLEAR_DATA_DELETING)); | 97 l10n_util::GetString(IDS_CLEAR_DATA_DELETING)); |
90 status_label_->SetVisible(false); | 98 status_label_->SetVisible(false); |
91 | 99 |
92 // Regular view controls we draw by ourself. First, we add the dialog label. | 100 // Regular view controls we draw by ourself. First, we add the dialog label. |
93 delete_all_label_ = new views::Label( | 101 delete_all_label_ = new views::Label( |
94 l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_LABEL)); | 102 l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_LABEL)); |
95 AddChildView(delete_all_label_); | 103 AddChildView(delete_all_label_); |
96 | 104 |
97 // Add all the check-boxes. | 105 // Add all the check-boxes. |
98 del_history_checkbox_ = | 106 del_history_checkbox_ = AddCheckbox( |
99 AddCheckbox(l10n_util::GetString(IDS_DEL_BROWSING_HISTORY_CHKBOX), | 107 l10n_util::GetString(IDS_DEL_BROWSING_HISTORY_CHKBOX), |
100 profile_->GetPrefs()->GetBoolean(prefs::kDeleteBrowsingHistory)); | 108 profile_->GetPrefs()->GetBoolean(prefs::kDeleteBrowsingHistory)); |
101 | 109 |
102 del_downloads_checkbox_ = | 110 del_downloads_checkbox_ = AddCheckbox( |
103 AddCheckbox(l10n_util::GetString(IDS_DEL_DOWNLOAD_HISTORY_CHKBOX), | 111 l10n_util::GetString(IDS_DEL_DOWNLOAD_HISTORY_CHKBOX), |
104 profile_->GetPrefs()->GetBoolean(prefs::kDeleteDownloadHistory)); | 112 profile_->GetPrefs()->GetBoolean(prefs::kDeleteDownloadHistory)); |
105 | 113 |
106 del_cache_checkbox_ = | 114 del_cache_checkbox_ = AddCheckbox( |
107 AddCheckbox(l10n_util::GetString(IDS_DEL_CACHE_CHKBOX), | 115 l10n_util::GetString(IDS_DEL_CACHE_CHKBOX), |
108 profile_->GetPrefs()->GetBoolean(prefs::kDeleteCache)); | 116 profile_->GetPrefs()->GetBoolean(prefs::kDeleteCache)); |
109 | 117 |
110 del_cookies_checkbox_ = | 118 del_cookies_checkbox_ = AddCheckbox( |
111 AddCheckbox(l10n_util::GetString(IDS_DEL_COOKIES_CHKBOX), | 119 l10n_util::GetString(IDS_DEL_COOKIES_CHKBOX), |
112 profile_->GetPrefs()->GetBoolean(prefs::kDeleteCookies)); | 120 profile_->GetPrefs()->GetBoolean(prefs::kDeleteCookies)); |
113 | 121 |
114 del_passwords_checkbox_ = | 122 del_passwords_checkbox_ = AddCheckbox( |
115 AddCheckbox(l10n_util::GetString(IDS_DEL_PASSWORDS_CHKBOX), | 123 l10n_util::GetString(IDS_DEL_PASSWORDS_CHKBOX), |
116 profile_->GetPrefs()->GetBoolean(prefs::kDeletePasswords)); | 124 profile_->GetPrefs()->GetBoolean(prefs::kDeletePasswords)); |
117 | 125 |
118 del_form_data_checkbox_ = | 126 del_lso_data_checkbox_ = AddCheckbox( |
119 AddCheckbox(l10n_util::GetString(IDS_DEL_FORM_DATA_CHKBOX), | 127 l10n_util::GetString(IDS_DEL_FLASH_DATA_CHKBOX), |
| 128 false); |
| 129 UpdateDelLSODataState(); |
| 130 |
| 131 del_form_data_checkbox_ = AddCheckbox( |
| 132 l10n_util::GetString(IDS_DEL_FORM_DATA_CHKBOX), |
120 profile_->GetPrefs()->GetBoolean(prefs::kDeleteFormData)); | 133 profile_->GetPrefs()->GetBoolean(prefs::kDeleteFormData)); |
121 | 134 |
122 // Add a label which appears before the combo box for the time period. | 135 // Add a label which appears before the combo box for the time period. |
123 time_period_label_ = new views::Label( | 136 time_period_label_ = new views::Label( |
124 l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_TIME_LABEL)); | 137 l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_TIME_LABEL)); |
125 AddChildView(time_period_label_); | 138 AddChildView(time_period_label_); |
126 | 139 |
127 // Add the combo box showing how far back in time we want to delete. | 140 // Add the combo box showing how far back in time we want to delete. |
128 time_period_combobox_ = new views::Combobox(this); | 141 time_period_combobox_ = new views::Combobox(this); |
129 time_period_combobox_->SetSelectedItem(profile_->GetPrefs()->GetInteger( | 142 time_period_combobox_->SetSelectedItem(profile_->GetPrefs()->GetInteger( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 kRelatedControlVerticalSpacing, | 214 kRelatedControlVerticalSpacing, |
202 sz.width(), sz.height()); | 215 sz.width(), sz.height()); |
203 | 216 |
204 sz = del_passwords_checkbox_->GetPreferredSize(); | 217 sz = del_passwords_checkbox_->GetPreferredSize(); |
205 del_passwords_checkbox_->SetBounds(2 * kPanelHorizMargin, | 218 del_passwords_checkbox_->SetBounds(2 * kPanelHorizMargin, |
206 del_cookies_checkbox_->y() + | 219 del_cookies_checkbox_->y() + |
207 del_cookies_checkbox_->height() + | 220 del_cookies_checkbox_->height() + |
208 kRelatedControlVerticalSpacing, | 221 kRelatedControlVerticalSpacing, |
209 sz.width(), sz.height()); | 222 sz.width(), sz.height()); |
210 | 223 |
| 224 sz = del_lso_data_checkbox_->GetPreferredSize(); |
| 225 del_lso_data_checkbox_->SetBounds(2 * kPanelHorizMargin, |
| 226 del_passwords_checkbox_->y() + |
| 227 del_passwords_checkbox_->height() + |
| 228 kRelatedControlVerticalSpacing, |
| 229 sz.width(), sz.height()); |
| 230 |
211 sz = del_form_data_checkbox_->GetPreferredSize(); | 231 sz = del_form_data_checkbox_->GetPreferredSize(); |
212 del_form_data_checkbox_->SetBounds(2 * kPanelHorizMargin, | 232 del_form_data_checkbox_->SetBounds(2 * kPanelHorizMargin, |
213 del_passwords_checkbox_->y() + | 233 del_lso_data_checkbox_->y() + |
214 del_passwords_checkbox_->height() + | 234 del_lso_data_checkbox_->height() + |
215 kRelatedControlVerticalSpacing, | 235 kRelatedControlVerticalSpacing, |
216 sz.width(), sz.height()); | 236 sz.width(), sz.height()); |
217 | 237 |
218 // Time period label is next below the combo boxes. | 238 // Time period label is next below the combo boxes. |
219 sz = time_period_label_->GetPreferredSize(); | 239 sz = time_period_label_->GetPreferredSize(); |
220 time_period_label_->SetBounds(kPanelHorizMargin, | 240 time_period_label_->SetBounds(kPanelHorizMargin, |
221 del_form_data_checkbox_->y() + | 241 del_form_data_checkbox_->y() + |
222 del_form_data_checkbox_->height() + | 242 del_form_data_checkbox_->height() + |
223 kRelatedControlVerticalSpacing + | 243 kRelatedControlVerticalSpacing + |
224 kExtraMarginForTimePeriodLabel, | 244 kExtraMarginForTimePeriodLabel, |
(...skipping 30 matching lines...) Expand all Loading... |
255 MessageBoxFlags::DialogButton button) const { | 275 MessageBoxFlags::DialogButton button) const { |
256 if (delete_in_progress_) | 276 if (delete_in_progress_) |
257 return false; | 277 return false; |
258 | 278 |
259 if (button == MessageBoxFlags::DIALOGBUTTON_OK) { | 279 if (button == MessageBoxFlags::DIALOGBUTTON_OK) { |
260 return del_history_checkbox_->checked() || | 280 return del_history_checkbox_->checked() || |
261 del_downloads_checkbox_->checked() || | 281 del_downloads_checkbox_->checked() || |
262 del_cache_checkbox_->checked() || | 282 del_cache_checkbox_->checked() || |
263 del_cookies_checkbox_->checked() || | 283 del_cookies_checkbox_->checked() || |
264 del_passwords_checkbox_->checked() || | 284 del_passwords_checkbox_->checked() || |
| 285 del_lso_data_checkbox_->checked() || |
265 del_form_data_checkbox_->checked(); | 286 del_form_data_checkbox_->checked(); |
266 } | 287 } |
267 | 288 |
268 return true; | 289 return true; |
269 } | 290 } |
270 | 291 |
271 bool ClearBrowsingDataView::CanResize() const { | 292 bool ClearBrowsingDataView::CanResize() const { |
272 return false; | 293 return false; |
273 } | 294 } |
274 | 295 |
(...skipping 26 matching lines...) Expand all Loading... |
301 prefs->SetBoolean(prefs::kDeleteBrowsingHistory, | 322 prefs->SetBoolean(prefs::kDeleteBrowsingHistory, |
302 del_history_checkbox_->checked()); | 323 del_history_checkbox_->checked()); |
303 prefs->SetBoolean(prefs::kDeleteDownloadHistory, | 324 prefs->SetBoolean(prefs::kDeleteDownloadHistory, |
304 del_downloads_checkbox_->checked()); | 325 del_downloads_checkbox_->checked()); |
305 prefs->SetBoolean(prefs::kDeleteCache, | 326 prefs->SetBoolean(prefs::kDeleteCache, |
306 del_cache_checkbox_->checked()); | 327 del_cache_checkbox_->checked()); |
307 prefs->SetBoolean(prefs::kDeleteCookies, | 328 prefs->SetBoolean(prefs::kDeleteCookies, |
308 del_cookies_checkbox_->checked()); | 329 del_cookies_checkbox_->checked()); |
309 prefs->SetBoolean(prefs::kDeletePasswords, | 330 prefs->SetBoolean(prefs::kDeletePasswords, |
310 del_passwords_checkbox_->checked()); | 331 del_passwords_checkbox_->checked()); |
| 332 if (del_lso_data_enabled_.GetValue()) { |
| 333 prefs->SetBoolean(prefs::kDeleteLSOData, |
| 334 del_lso_data_checkbox_->checked()); |
| 335 } |
311 prefs->SetBoolean(prefs::kDeleteFormData, | 336 prefs->SetBoolean(prefs::kDeleteFormData, |
312 del_form_data_checkbox_->checked()); | 337 del_form_data_checkbox_->checked()); |
313 OnDelete(); | 338 OnDelete(); |
314 return false; // We close the dialog in OnBrowsingDataRemoverDone(). | 339 return false; // We close the dialog in OnBrowsingDataRemoverDone(). |
315 } | 340 } |
316 | 341 |
317 views::View* ClearBrowsingDataView::GetContentsView() { | 342 views::View* ClearBrowsingDataView::GetContentsView() { |
318 return this; | 343 return this; |
319 } | 344 } |
320 | 345 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 //////////////////////////////////////////////////////////////////////////////// | 402 //////////////////////////////////////////////////////////////////////////////// |
378 // ClearBrowsingDataView, views::ButtonListener implementation: | 403 // ClearBrowsingDataView, views::ButtonListener implementation: |
379 | 404 |
380 void ClearBrowsingDataView::ButtonPressed(views::Button* sender, | 405 void ClearBrowsingDataView::ButtonPressed(views::Button* sender, |
381 const views::Event& event) { | 406 const views::Event& event) { |
382 // When no checkbox is checked we should not have the action button enabled. | 407 // When no checkbox is checked we should not have the action button enabled. |
383 // This forces the button to evaluate what state they should be in. | 408 // This forces the button to evaluate what state they should be in. |
384 GetDialogClientView()->UpdateDialogButtons(); | 409 GetDialogClientView()->UpdateDialogButtons(); |
385 } | 410 } |
386 | 411 |
| 412 //////////////////////////////////////////////////////////////////////////////// |
| 413 // ClearBrowsingDataView, views::LinkController implementation: |
| 414 |
387 void ClearBrowsingDataView::LinkActivated(views::Link* source, | 415 void ClearBrowsingDataView::LinkActivated(views::Link* source, |
388 int event_flags) { | 416 int event_flags) { |
389 Browser* browser = Browser::Create(profile_); | 417 Browser* browser = Browser::Create(profile_); |
390 browser->OpenURL(GURL(l10n_util::GetStringUTF8(IDS_FLASH_STORAGE_URL)), | 418 browser->OpenURL(GURL(l10n_util::GetStringUTF8(IDS_FLASH_STORAGE_URL)), |
391 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); | 419 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); |
392 browser->window()->Show(); | 420 browser->window()->Show(); |
393 } | 421 } |
394 | 422 |
395 //////////////////////////////////////////////////////////////////////////////// | 423 //////////////////////////////////////////////////////////////////////////////// |
| 424 // ClearBrowsingDataView, NotificationObserver implementation: |
| 425 |
| 426 void ClearBrowsingDataView::Observe(NotificationType type, |
| 427 const NotificationSource& source, |
| 428 const NotificationDetails& details) { |
| 429 if (type == NotificationType::PREF_CHANGED) { |
| 430 const std::string& pref = *(Details<std::string>(details).ptr()); |
| 431 if (pref == prefs::kClearPluginLSODataEnabled) { |
| 432 UpdateControlState(); |
| 433 } |
| 434 } |
| 435 } |
| 436 |
| 437 //////////////////////////////////////////////////////////////////////////////// |
396 // ClearBrowsingDataView, private: | 438 // ClearBrowsingDataView, private: |
397 | 439 |
398 views::Checkbox* ClearBrowsingDataView::AddCheckbox(const std::wstring& text, | 440 views::Checkbox* ClearBrowsingDataView::AddCheckbox(const std::wstring& text, |
399 bool checked) { | 441 bool checked) { |
400 views::Checkbox* checkbox = new views::Checkbox(text); | 442 views::Checkbox* checkbox = new views::Checkbox(text); |
401 checkbox->SetChecked(checked); | 443 checkbox->SetChecked(checked); |
402 checkbox->set_listener(this); | 444 checkbox->set_listener(this); |
403 AddChildView(checkbox); | 445 AddChildView(checkbox); |
404 return checkbox; | 446 return checkbox; |
405 } | 447 } |
406 | 448 |
407 void ClearBrowsingDataView::UpdateControlEnabledState() { | 449 void ClearBrowsingDataView::UpdateDelLSODataState() { |
| 450 bool enabled = del_lso_data_enabled_.GetValue(); |
| 451 del_lso_data_checkbox_->SetChecked( |
| 452 enabled && |
| 453 profile_->GetPrefs()->GetBoolean(prefs::kDeleteLSOData)); |
| 454 del_lso_data_checkbox_->SetTooltipText( |
| 455 enabled ? std::wstring() |
| 456 : l10n_util::GetString(IDS_LSO_CLEAR_MESSAGE).c_str()); |
| 457 del_lso_data_checkbox_->SetEnabled(enabled && !delete_in_progress_); |
| 458 } |
| 459 |
| 460 void ClearBrowsingDataView::UpdateControlState() { |
408 window()->EnableClose(!delete_in_progress_); | 461 window()->EnableClose(!delete_in_progress_); |
409 | 462 |
| 463 UpdateDelLSODataState(); |
410 del_history_checkbox_->SetEnabled(!delete_in_progress_); | 464 del_history_checkbox_->SetEnabled(!delete_in_progress_); |
411 del_downloads_checkbox_->SetEnabled(!delete_in_progress_); | 465 del_downloads_checkbox_->SetEnabled(!delete_in_progress_); |
412 del_cache_checkbox_->SetEnabled(!delete_in_progress_); | 466 del_cache_checkbox_->SetEnabled(!delete_in_progress_); |
413 del_cookies_checkbox_->SetEnabled(!delete_in_progress_); | 467 del_cookies_checkbox_->SetEnabled(!delete_in_progress_); |
414 del_passwords_checkbox_->SetEnabled(!delete_in_progress_); | 468 del_passwords_checkbox_->SetEnabled(!delete_in_progress_); |
415 del_form_data_checkbox_->SetEnabled(!delete_in_progress_); | 469 del_form_data_checkbox_->SetEnabled(!delete_in_progress_); |
416 time_period_combobox_->SetEnabled(!delete_in_progress_); | 470 time_period_combobox_->SetEnabled(!delete_in_progress_); |
417 | 471 |
418 status_label_->SetVisible(delete_in_progress_); | 472 status_label_->SetVisible(delete_in_progress_); |
419 throbber_->SetVisible(delete_in_progress_); | 473 throbber_->SetVisible(delete_in_progress_); |
(...skipping 17 matching lines...) Expand all Loading... |
437 | 491 |
438 int remove_mask = 0; | 492 int remove_mask = 0; |
439 if (IsCheckBoxEnabledAndSelected(del_history_checkbox_)) | 493 if (IsCheckBoxEnabledAndSelected(del_history_checkbox_)) |
440 remove_mask |= BrowsingDataRemover::REMOVE_HISTORY; | 494 remove_mask |= BrowsingDataRemover::REMOVE_HISTORY; |
441 if (IsCheckBoxEnabledAndSelected(del_downloads_checkbox_)) | 495 if (IsCheckBoxEnabledAndSelected(del_downloads_checkbox_)) |
442 remove_mask |= BrowsingDataRemover::REMOVE_DOWNLOADS; | 496 remove_mask |= BrowsingDataRemover::REMOVE_DOWNLOADS; |
443 if (IsCheckBoxEnabledAndSelected(del_cookies_checkbox_)) | 497 if (IsCheckBoxEnabledAndSelected(del_cookies_checkbox_)) |
444 remove_mask |= BrowsingDataRemover::REMOVE_COOKIES; | 498 remove_mask |= BrowsingDataRemover::REMOVE_COOKIES; |
445 if (IsCheckBoxEnabledAndSelected(del_passwords_checkbox_)) | 499 if (IsCheckBoxEnabledAndSelected(del_passwords_checkbox_)) |
446 remove_mask |= BrowsingDataRemover::REMOVE_PASSWORDS; | 500 remove_mask |= BrowsingDataRemover::REMOVE_PASSWORDS; |
| 501 if (IsCheckBoxEnabledAndSelected(del_lso_data_checkbox_)) |
| 502 remove_mask |= BrowsingDataRemover::REMOVE_LSO_DATA; |
447 if (IsCheckBoxEnabledAndSelected(del_form_data_checkbox_)) | 503 if (IsCheckBoxEnabledAndSelected(del_form_data_checkbox_)) |
448 remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA; | 504 remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA; |
449 if (IsCheckBoxEnabledAndSelected(del_cache_checkbox_)) | 505 if (IsCheckBoxEnabledAndSelected(del_cache_checkbox_)) |
450 remove_mask |= BrowsingDataRemover::REMOVE_CACHE; | 506 remove_mask |= BrowsingDataRemover::REMOVE_CACHE; |
451 | 507 |
452 delete_in_progress_ = true; | 508 delete_in_progress_ = true; |
453 UpdateControlEnabledState(); | 509 UpdateControlState(); |
454 | 510 |
455 // BrowsingDataRemover deletes itself when done. | 511 // BrowsingDataRemover deletes itself when done. |
456 remover_ = new BrowsingDataRemover(profile_, | 512 remover_ = new BrowsingDataRemover(profile_, |
457 static_cast<BrowsingDataRemover::TimePeriod>(period_selected), | 513 static_cast<BrowsingDataRemover::TimePeriod>(period_selected), |
458 base::Time()); | 514 base::Time()); |
459 remover_->AddObserver(this); | 515 remover_->AddObserver(this); |
460 remover_->Remove(remove_mask); | 516 remover_->Remove(remove_mask); |
461 } | 517 } |
462 | 518 |
463 void ClearBrowsingDataView::OnBrowsingDataRemoverDone() { | 519 void ClearBrowsingDataView::OnBrowsingDataRemoverDone() { |
464 // No need to remove ourselves as an observer as BrowsingDataRemover deletes | 520 // No need to remove ourselves as an observer as BrowsingDataRemover deletes |
465 // itself after we return. | 521 // itself after we return. |
466 remover_ = NULL; | 522 remover_ = NULL; |
467 window()->Close(); | 523 window()->Close(); |
468 } | 524 } |
OLD | NEW |