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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 308 } |
309 | 309 |
310 void ClearBrowsingDataHandler::UpdateHistoryDeletionDialog(bool show) { | 310 void ClearBrowsingDataHandler::UpdateHistoryDeletionDialog(bool show) { |
311 // This is used by OnClearingTaskFinished (when the deletion finishes). | 311 // This is used by OnClearingTaskFinished (when the deletion finishes). |
312 show_history_deletion_dialog_ = show; | 312 show_history_deletion_dialog_ = show; |
313 } | 313 } |
314 | 314 |
315 void ClearBrowsingDataHandler::AddCounter( | 315 void ClearBrowsingDataHandler::AddCounter( |
316 std::unique_ptr<browsing_data::BrowsingDataCounter> counter) { | 316 std::unique_ptr<browsing_data::BrowsingDataCounter> counter) { |
317 counter->Init(profile_->GetPrefs(), | 317 counter->Init(profile_->GetPrefs(), |
| 318 browsing_data::ClearBrowsingDataPreferenceType::DEFAULT, |
318 base::Bind(&ClearBrowsingDataHandler::UpdateCounterText, | 319 base::Bind(&ClearBrowsingDataHandler::UpdateCounterText, |
319 base::Unretained(this))); | 320 base::Unretained(this))); |
320 counters_.push_back(std::move(counter)); | 321 counters_.push_back(std::move(counter)); |
321 } | 322 } |
322 | 323 |
323 void ClearBrowsingDataHandler::UpdateCounterText( | 324 void ClearBrowsingDataHandler::UpdateCounterText( |
324 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result) { | 325 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result) { |
325 CallJavascriptFunction( | 326 CallJavascriptFunction( |
326 "cr.webUIListenerCallback", | 327 "cr.webUIListenerCallback", base::StringValue("update-counter-text"), |
327 base::StringValue("update-counter-text"), | |
328 base::StringValue(result->source()->GetPrefName()), | 328 base::StringValue(result->source()->GetPrefName()), |
329 base::StringValue(GetChromeCounterTextFromResult(result.get()))); | 329 base::StringValue(GetChromeCounterTextFromResult(result.get()))); |
330 } | 330 } |
331 | 331 |
332 } // namespace settings | 332 } // namespace settings |
OLD | NEW |