| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ios/chrome/browser/browsing_data/browsing_data_counter_wrapper.h" | 5 #include "ios/chrome/browser/browsing_data/browsing_data_counter_wrapper.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "components/prefs/pref_service.h" | 9 #include "components/prefs/pref_service.h" |
| 10 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 10 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 void BrowsingDataCounterWrapper::RestartCounter() { | 32 void BrowsingDataCounterWrapper::RestartCounter() { |
| 33 counter_->Restart(); | 33 counter_->Restart(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 BrowsingDataCounterWrapper::BrowsingDataCounterWrapper( | 36 BrowsingDataCounterWrapper::BrowsingDataCounterWrapper( |
| 37 std::unique_ptr<browsing_data::BrowsingDataCounter> counter, | 37 std::unique_ptr<browsing_data::BrowsingDataCounter> counter, |
| 38 PrefService* pref_service, | 38 PrefService* pref_service, |
| 39 const UpdateUICallback& update_ui_callback) | 39 const UpdateUICallback& update_ui_callback) |
| 40 : counter_(std::move(counter)), update_ui_callback_(update_ui_callback) { | 40 : counter_(std::move(counter)), update_ui_callback_(update_ui_callback) { |
| 41 counter_->Init(pref_service, | 41 counter_->Init(pref_service, browsing_data::ClearBrowsingDataTab::ADVANCED, |
| 42 base::Bind(&BrowsingDataCounterWrapper::UpdateWithResult, | 42 base::Bind(&BrowsingDataCounterWrapper::UpdateWithResult, |
| 43 base::Unretained(this))); | 43 base::Unretained(this))); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void BrowsingDataCounterWrapper::UpdateWithResult( | 46 void BrowsingDataCounterWrapper::UpdateWithResult( |
| 47 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result) { | 47 std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result) { |
| 48 update_ui_callback_.Run(*result.get()); | 48 update_ui_callback_.Run(*result.get()); |
| 49 } | 49 } |
| OLD | NEW |