| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/options/clear_browser_data_handler.h" | 5 #include "chrome/browser/ui/webui/options/clear_browser_data_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 [prefs](const std::string& pref) { return prefs->GetBoolean(pref); }); | 311 [prefs](const std::string& pref) { return prefs->GetBoolean(pref); }); |
| 312 UMA_HISTOGRAM_SPARSE_SLOWLY( | 312 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 313 "History.ClearBrowsingData.PasswordsDeletion.AdditionalDatatypesCount", | 313 "History.ClearBrowsingData.PasswordsDeletion.AdditionalDatatypesCount", |
| 314 checked_other_types); | 314 checked_other_types); |
| 315 } | 315 } |
| 316 | 316 |
| 317 remover_ = BrowsingDataRemoverFactory::GetForBrowserContext(profile); | 317 remover_ = BrowsingDataRemoverFactory::GetForBrowserContext(profile); |
| 318 remover_->AddObserver(this); | 318 remover_->AddObserver(this); |
| 319 int period_selected = | 319 int period_selected = |
| 320 prefs->GetInteger(browsing_data::prefs::kDeleteTimePeriod); | 320 prefs->GetInteger(browsing_data::prefs::kDeleteTimePeriod); |
| 321 remover_->Remove(BrowsingDataRemover::Period( | 321 remover_->RemoveAndReply( |
| 322 static_cast<browsing_data::TimePeriod>(period_selected)), | 322 BrowsingDataRemover::Period( |
| 323 remove_mask, origin_mask); | 323 static_cast<browsing_data::TimePeriod>(period_selected)), |
| 324 remove_mask, origin_mask, this); |
| 324 | 325 |
| 325 // Store the clear browsing data time. Next time the clear browsing data | 326 // Store the clear browsing data time. Next time the clear browsing data |
| 326 // dialog is open, this time is used to decide whether to display an info | 327 // dialog is open, this time is used to decide whether to display an info |
| 327 // banner or not. | 328 // banner or not. |
| 328 prefs->SetInt64(prefs::kLastClearBrowsingDataTime, | 329 prefs->SetInt64(prefs::kLastClearBrowsingDataTime, |
| 329 base::Time::Now().ToInternalValue()); | 330 base::Time::Now().ToInternalValue()); |
| 330 } | 331 } |
| 331 | 332 |
| 332 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() { | 333 void ClearBrowserDataHandler::OnBrowsingDataRemoverDone() { |
| 333 remover_->RemoveObserver(this); | 334 remover_->RemoveObserver(this); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 "History.ClearBrowsingData.HistoryNoticeShownInFooterWhenUpdated", | 424 "History.ClearBrowsingData.HistoryNoticeShownInFooterWhenUpdated", |
| 424 should_show_history_notice_); | 425 should_show_history_notice_); |
| 425 } | 426 } |
| 426 | 427 |
| 427 void ClearBrowserDataHandler::UpdateHistoryDeletionDialog(bool show) { | 428 void ClearBrowserDataHandler::UpdateHistoryDeletionDialog(bool show) { |
| 428 // This is used by OnBrowsingDataRemoverDone (when the deletion finishes). | 429 // This is used by OnBrowsingDataRemoverDone (when the deletion finishes). |
| 429 should_show_history_deletion_dialog_ = show; | 430 should_show_history_deletion_dialog_ = show; |
| 430 } | 431 } |
| 431 | 432 |
| 432 } // namespace options | 433 } // namespace options |
| OLD | NEW |