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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_counter_utils.cc

Issue 2594723002: Count number of origins with data affected by clearing "cookies and site data". (Closed)
Patch Set: Add comments for issues with incomplete data deletion Created 3 years, 11 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
OLDNEW
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/browsing_data/browsing_data_counter_utils.h" 5 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browsing_data/cache_counter.h" 9 #include "chrome/browser/browsing_data/cache_counter.h"
10 #include "chrome/browser/browsing_data/media_licenses_counter.h" 10 #include "chrome/browser/browsing_data/media_licenses_counter.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 if (cache_size_bytes >= kBytesInAMegabyte) { 74 if (cache_size_bytes >= kBytesInAMegabyte) {
75 base::string16 formatted_size = FormatBytesMBOrHigher(cache_size_bytes); 75 base::string16 formatted_size = FormatBytesMBOrHigher(cache_size_bytes);
76 return !is_upper_limit 76 return !is_upper_limit
77 ? formatted_size 77 ? formatted_size
78 : l10n_util::GetStringFUTF16( 78 : l10n_util::GetStringFUTF16(
79 IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE, formatted_size); 79 IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE, formatted_size);
80 } 80 }
81 return l10n_util::GetStringUTF16(IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY); 81 return l10n_util::GetStringUTF16(IDS_DEL_CACHE_COUNTER_ALMOST_EMPTY);
82 } 82 }
83 83
84 if (pref_name == browsing_data::prefs::kDeleteCookies) {
85 // Cookie counter.
86 browsing_data::BrowsingDataCounter::ResultInt origin_count =
87 static_cast<const browsing_data::BrowsingDataCounter::FinishedResult*>(
88 result)
89 ->Value();
90 std::ostringstream result;
91 result << origin_count;
92 return base::UTF8ToUTF16(result.str());
msramek 2017/01/09 12:54:43 We should definitely output more than just a numbe
dullweber 2017/01/09 16:05:45 I added the new string from the discussion documen
93 }
94
84 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) { 95 if (pref_name == browsing_data::prefs::kDeleteMediaLicenses) {
85 const MediaLicensesCounter::MediaLicenseResult* media_license_result = 96 const MediaLicensesCounter::MediaLicenseResult* media_license_result =
86 static_cast<const MediaLicensesCounter::MediaLicenseResult*>(result); 97 static_cast<const MediaLicensesCounter::MediaLicenseResult*>(result);
87 if (media_license_result->Value() > 0) { 98 if (media_license_result->Value() > 0) {
88 return l10n_util::GetStringFUTF16( 99 return l10n_util::GetStringFUTF16(
89 IDS_DEL_MEDIA_LICENSES_COUNTER_SITE_COMMENT, 100 IDS_DEL_MEDIA_LICENSES_COUNTER_SITE_COMMENT,
90 base::UTF8ToUTF16(media_license_result->GetOneOrigin())); 101 base::UTF8ToUTF16(media_license_result->GetOneOrigin()));
91 } 102 }
92 return l10n_util::GetStringUTF16( 103 return l10n_util::GetStringUTF16(
93 IDS_DEL_MEDIA_LICENSES_COUNTER_GENERAL_COMMENT); 104 IDS_DEL_MEDIA_LICENSES_COUNTER_GENERAL_COMMENT);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return base::ReplaceStringPlaceholders( 136 return base::ReplaceStringPlaceholders(
126 l10n_util::GetPluralStringFUTF16( 137 l10n_util::GetPluralStringFUTF16(
127 IDS_DEL_HOSTED_APPS_COUNTER, hosted_apps_count), 138 IDS_DEL_HOSTED_APPS_COUNTER, hosted_apps_count),
128 replacements, 139 replacements,
129 nullptr); 140 nullptr);
130 } 141 }
131 #endif 142 #endif
132 143
133 return browsing_data::GetCounterTextFromResult(result); 144 return browsing_data::GetCounterTextFromResult(result);
134 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698