| 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 "components/browsing_data/core/browsing_data_utils.h" | 5 #include "components/browsing_data/core/browsing_data_utils.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
| 9 #include "components/browsing_data/core/counters/autofill_counter.h" | 9 #include "components/browsing_data/core/counters/autofill_counter.h" |
| 10 #include "components/browsing_data/core/counters/history_counter.h" | 10 #include "components/browsing_data/core/counters/history_counter.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 base::RecordAction(base::UserMetricsAction( | 84 base::RecordAction(base::UserMetricsAction( |
| 85 "ClearBrowsingData_TimePeriodChanged_LastMonth")); | 85 "ClearBrowsingData_TimePeriodChanged_LastMonth")); |
| 86 break; | 86 break; |
| 87 case TimePeriod::ALL_TIME: | 87 case TimePeriod::ALL_TIME: |
| 88 base::RecordAction(base::UserMetricsAction( | 88 base::RecordAction(base::UserMetricsAction( |
| 89 "ClearBrowsingData_TimePeriodChanged_Everything")); | 89 "ClearBrowsingData_TimePeriodChanged_Everything")); |
| 90 break; | 90 break; |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 void RecordDeletionFromTab(ClearBrowsingDataTab tab) { | |
| 95 UMA_HISTOGRAM_ENUMERATION("History.ClearBrowsingData.UserDeletedFromTab", tab, | |
| 96 browsing_data::ClearBrowsingDataTab::NUM_TYPES); | |
| 97 switch (tab) { | |
| 98 case ClearBrowsingDataTab::BASIC: | |
| 99 base::RecordAction(base::UserMetricsAction("ClearBrowsingData_BasicTab")); | |
| 100 break; | |
| 101 case ClearBrowsingDataTab::ADVANCED: | |
| 102 base::RecordAction( | |
| 103 base::UserMetricsAction("ClearBrowsingData_AdvancedTab")); | |
| 104 break; | |
| 105 case ClearBrowsingDataTab::NUM_TYPES: | |
| 106 NOTREACHED(); | |
| 107 } | |
| 108 } | |
| 109 | |
| 110 base::string16 GetCounterTextFromResult( | 94 base::string16 GetCounterTextFromResult( |
| 111 const BrowsingDataCounter::Result* result) { | 95 const BrowsingDataCounter::Result* result) { |
| 112 base::string16 text; | 96 base::string16 text; |
| 113 std::string pref_name = result->source()->GetPrefName(); | 97 std::string pref_name = result->source()->GetPrefName(); |
| 114 | 98 |
| 115 if (!result->Finished()) { | 99 if (!result->Finished()) { |
| 116 // The counter is still counting. | 100 // The counter is still counting. |
| 117 text = l10n_util::GetStringUTF16(IDS_CLEAR_BROWSING_DATA_CALCULATING); | 101 text = l10n_util::GetStringUTF16(IDS_CLEAR_BROWSING_DATA_CALCULATING); |
| 118 | 102 |
| 119 } else if (pref_name == prefs::kDeletePasswords) { | 103 } else if (pref_name == prefs::kDeletePasswords) { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 prefs->GetBoolean(prefs::kDeleteCache)); | 277 prefs->GetBoolean(prefs::kDeleteCache)); |
| 294 prefs->SetBoolean(prefs::kDeleteCookiesBasic, | 278 prefs->SetBoolean(prefs::kDeleteCookiesBasic, |
| 295 prefs->GetBoolean(prefs::kDeleteCookies)); | 279 prefs->GetBoolean(prefs::kDeleteCookies)); |
| 296 prefs->SetInteger(prefs::kDeleteTimePeriodBasic, | 280 prefs->SetInteger(prefs::kDeleteTimePeriodBasic, |
| 297 prefs->GetInteger(prefs::kDeleteTimePeriod)); | 281 prefs->GetInteger(prefs::kDeleteTimePeriod)); |
| 298 prefs->SetBoolean(prefs::kPreferencesMigratedToBasic, true); | 282 prefs->SetBoolean(prefs::kPreferencesMigratedToBasic, true); |
| 299 } | 283 } |
| 300 } | 284 } |
| 301 | 285 |
| 302 } // namespace browsing_data | 286 } // namespace browsing_data |
| OLD | NEW |