| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 remove_mask |= site_data_mask; | 99 remove_mask |= site_data_mask; |
| 100 origin_mask |= BrowsingDataHelper::UNPROTECTED_WEB; | 100 origin_mask |= BrowsingDataHelper::UNPROTECTED_WEB; |
| 101 } | 101 } |
| 102 | 102 |
| 103 if (prefs->GetBoolean(prefs::kDeletePasswords)) | 103 if (prefs->GetBoolean(prefs::kDeletePasswords)) |
| 104 remove_mask |= BrowsingDataRemover::REMOVE_PASSWORDS; | 104 remove_mask |= BrowsingDataRemover::REMOVE_PASSWORDS; |
| 105 | 105 |
| 106 if (prefs->GetBoolean(prefs::kDeleteFormData)) | 106 if (prefs->GetBoolean(prefs::kDeleteFormData)) |
| 107 remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA; | 107 remove_mask |= BrowsingDataRemover::REMOVE_FORM_DATA; |
| 108 | 108 |
| 109 // Clearing Content Licenses is only supported in Pepper Flash. | 109 if (prefs->GetBoolean(prefs::kDeleteMediaLicenses)) |
| 110 if (prefs->GetBoolean(prefs::kDeauthorizeContentLicenses) && | 110 remove_mask |= BrowsingDataRemover::REMOVE_MEDIA_LICENSES; |
| 111 *pepper_flash_settings_enabled_) { | |
| 112 remove_mask |= BrowsingDataRemover::REMOVE_CONTENT_LICENSES; | |
| 113 } | |
| 114 | 111 |
| 115 if (prefs->GetBoolean(prefs::kDeleteHostedAppsData)) { | 112 if (prefs->GetBoolean(prefs::kDeleteHostedAppsData)) { |
| 116 remove_mask |= site_data_mask; | 113 remove_mask |= site_data_mask; |
| 117 origin_mask |= BrowsingDataHelper::PROTECTED_WEB; | 114 origin_mask |= BrowsingDataHelper::PROTECTED_WEB; |
| 118 } | 115 } |
| 119 | 116 |
| 120 // Record the deletion of cookies and cache. | 117 // Record the deletion of cookies and cache. |
| 121 BrowsingDataRemover::CookieOrCacheDeletionChoice choice = | 118 BrowsingDataRemover::CookieOrCacheDeletionChoice choice = |
| 122 BrowsingDataRemover::NEITHER_COOKIES_NOR_CACHE; | 119 BrowsingDataRemover::NEITHER_COOKIES_NOR_CACHE; |
| 123 if (prefs->GetBoolean(prefs::kDeleteCookies)) { | 120 if (prefs->GetBoolean(prefs::kDeleteCookies)) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 134 | 131 |
| 135 // Record the circumstances under which passwords are deleted. | 132 // Record the circumstances under which passwords are deleted. |
| 136 if (prefs->GetBoolean(prefs::kDeletePasswords)) { | 133 if (prefs->GetBoolean(prefs::kDeletePasswords)) { |
| 137 static const char* other_types[] = { | 134 static const char* other_types[] = { |
| 138 prefs::kDeleteBrowsingHistory, | 135 prefs::kDeleteBrowsingHistory, |
| 139 prefs::kDeleteDownloadHistory, | 136 prefs::kDeleteDownloadHistory, |
| 140 prefs::kDeleteCache, | 137 prefs::kDeleteCache, |
| 141 prefs::kDeleteCookies, | 138 prefs::kDeleteCookies, |
| 142 prefs::kDeleteFormData, | 139 prefs::kDeleteFormData, |
| 143 prefs::kDeleteHostedAppsData, | 140 prefs::kDeleteHostedAppsData, |
| 144 prefs::kDeauthorizeContentLicenses, | 141 prefs::kDeleteMediaLicenses, |
| 145 }; | 142 }; |
| 146 static size_t num_other_types = arraysize(other_types); | 143 static size_t num_other_types = arraysize(other_types); |
| 147 int checked_other_types = std::count_if( | 144 int checked_other_types = std::count_if( |
| 148 other_types, other_types + num_other_types, | 145 other_types, other_types + num_other_types, |
| 149 [prefs](const std::string& pref) { return prefs->GetBoolean(pref); }); | 146 [prefs](const std::string& pref) { return prefs->GetBoolean(pref); }); |
| 150 UMA_HISTOGRAM_SPARSE_SLOWLY( | 147 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 151 "History.ClearBrowsingData.PasswordsDeletion.AdditionalDatatypesCount", | 148 "History.ClearBrowsingData.PasswordsDeletion.AdditionalDatatypesCount", |
| 152 checked_other_types); | 149 checked_other_types); |
| 153 } | 150 } |
| 154 | 151 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void ClearBrowsingDataHandler::UpdateHistoryNotice(bool show) { | 199 void ClearBrowsingDataHandler::UpdateHistoryNotice(bool show) { |
| 203 should_show_history_footer_ = show; | 200 should_show_history_footer_ = show; |
| 204 OnStateChanged(); | 201 OnStateChanged(); |
| 205 | 202 |
| 206 UMA_HISTOGRAM_BOOLEAN( | 203 UMA_HISTOGRAM_BOOLEAN( |
| 207 "History.ClearBrowsingData.HistoryNoticeShownInFooterWhenUpdated", | 204 "History.ClearBrowsingData.HistoryNoticeShownInFooterWhenUpdated", |
| 208 should_show_history_footer_); | 205 should_show_history_footer_); |
| 209 } | 206 } |
| 210 | 207 |
| 211 } // namespace settings | 208 } // namespace settings |
| OLD | NEW |