| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/settings/settings_clear_browsing_data_handler.
h" | 5 #include "chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.
h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 } | 310 } |
| 311 | 311 |
| 312 void ClearBrowsingDataHandler::UpdateHistoryDeletionDialog(bool show) { | 312 void ClearBrowsingDataHandler::UpdateHistoryDeletionDialog(bool show) { |
| 313 // This is used by OnClearingTaskFinished (when the deletion finishes). | 313 // This is used by OnClearingTaskFinished (when the deletion finishes). |
| 314 show_history_deletion_dialog_ = show; | 314 show_history_deletion_dialog_ = show; |
| 315 } | 315 } |
| 316 | 316 |
| 317 void ClearBrowsingDataHandler::AddCounter( | 317 void ClearBrowsingDataHandler::AddCounter( |
| 318 std::unique_ptr<browsing_data::BrowsingDataCounter> counter) { | 318 std::unique_ptr<browsing_data::BrowsingDataCounter> counter) { |
| 319 counter->Init(profile_->GetPrefs(), | 319 counter->Init(profile_->GetPrefs(), |
| 320 browsing_data::ClearBrowsingDataTab::ADVANCED, |
| 320 base::Bind(&ClearBrowsingDataHandler::UpdateCounterText, | 321 base::Bind(&ClearBrowsingDataHandler::UpdateCounterText, |
| 321 base::Unretained(this))); | 322 base::Unretained(this))); |
| 322 counters_.push_back(std::move(counter)); | 323 counters_.push_back(std::move(counter)); |
| 323 } | 324 } |
| 324 | 325 |
| 325 void ClearBrowsingDataHandler::UpdateCounterText( | 326 void ClearBrowsingDataHandler::UpdateCounterText( |
| 326 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result) { | 327 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result) { |
| 327 CallJavascriptFunction( | 328 CallJavascriptFunction( |
| 328 "cr.webUIListenerCallback", | 329 "cr.webUIListenerCallback", base::StringValue("update-counter-text"), |
| 329 base::StringValue("update-counter-text"), | |
| 330 base::StringValue(result->source()->GetPrefName()), | 330 base::StringValue(result->source()->GetPrefName()), |
| 331 base::StringValue(GetChromeCounterTextFromResult(result.get()))); | 331 base::StringValue(GetChromeCounterTextFromResult(result.get()))); |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace settings | 334 } // namespace settings |
| OLD | NEW |