| 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/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 other_types, other_types + num_other_types, | 145 other_types, other_types + num_other_types, |
| 146 [prefs](const std::string& pref) { return prefs->GetBoolean(pref); }); | 146 [prefs](const std::string& pref) { return prefs->GetBoolean(pref); }); |
| 147 UMA_HISTOGRAM_SPARSE_SLOWLY( | 147 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 148 "History.ClearBrowsingData.PasswordsDeletion.AdditionalDatatypesCount", | 148 "History.ClearBrowsingData.PasswordsDeletion.AdditionalDatatypesCount", |
| 149 checked_other_types); | 149 checked_other_types); |
| 150 } | 150 } |
| 151 | 151 |
| 152 int period_selected = prefs->GetInteger(prefs::kDeleteTimePeriod); | 152 int period_selected = prefs->GetInteger(prefs::kDeleteTimePeriod); |
| 153 remover_ = BrowsingDataRemoverFactory::GetForBrowserContext(profile); | 153 remover_ = BrowsingDataRemoverFactory::GetForBrowserContext(profile); |
| 154 remover_->AddObserver(this); | 154 remover_->AddObserver(this); |
| 155 remover_->Remove( | 155 remover_->Remove(Period(static_cast<TimePeriod>(period_selected)), |
| 156 BrowsingDataRemover::Period( | 156 remove_mask, origin_mask); |
| 157 static_cast<BrowsingDataRemover::TimePeriod>(period_selected)), | |
| 158 remove_mask, origin_mask); | |
| 159 } | 157 } |
| 160 | 158 |
| 161 void ClearBrowsingDataHandler::OnBrowsingDataRemoverDone() { | 159 void ClearBrowsingDataHandler::OnBrowsingDataRemoverDone() { |
| 162 remover_->RemoveObserver(this); | 160 remover_->RemoveObserver(this); |
| 163 remover_ = nullptr; | 161 remover_ = nullptr; |
| 164 ResolveJavascriptCallback( | 162 ResolveJavascriptCallback( |
| 165 base::StringValue(webui_callback_id_), | 163 base::StringValue(webui_callback_id_), |
| 166 *base::Value::CreateNullValue()); | 164 *base::Value::CreateNullValue()); |
| 167 webui_callback_id_.clear(); | 165 webui_callback_id_.clear(); |
| 168 } | 166 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 void ClearBrowsingDataHandler::UpdateHistoryNotice(bool show) { | 199 void ClearBrowsingDataHandler::UpdateHistoryNotice(bool show) { |
| 202 should_show_history_footer_ = show; | 200 should_show_history_footer_ = show; |
| 203 OnStateChanged(); | 201 OnStateChanged(); |
| 204 | 202 |
| 205 UMA_HISTOGRAM_BOOLEAN( | 203 UMA_HISTOGRAM_BOOLEAN( |
| 206 "History.ClearBrowsingData.HistoryNoticeShownInFooterWhenUpdated", | 204 "History.ClearBrowsingData.HistoryNoticeShownInFooterWhenUpdated", |
| 207 should_show_history_footer_); | 205 should_show_history_footer_); |
| 208 } | 206 } |
| 209 | 207 |
| 210 } // namespace settings | 208 } // namespace settings |
| OLD | NEW |