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

Side by Side Diff: chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc

Issue 2084903002: Moved BrowsingDataCounter and part of BrowsingDataCounterUtils to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed deps Created 4 years, 6 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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698