Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: components/browsing_data/core/browsing_data_utils.cc

Issue 2963973002: Log basic/advanced tab action from java (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/browsing_data/core/browsing_data_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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,
Bernhard Bauer 2017/06/29 17:13:18 Is this histogram now unused? In that case you sho
dullweber 2017/06/30 08:48:35 Thanks for noticing this. I forgot to add the hist
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
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
OLDNEW
« no previous file with comments | « components/browsing_data/core/browsing_data_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698