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

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

Issue 2118503005: [MD settings] disable clear browsing data while it is running (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: checking after page refresh Created 4 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
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/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 "cr.webUIListenerCallback", 207 "cr.webUIListenerCallback",
208 base::StringValue("browsing-history-pref-changed"), 208 base::StringValue("browsing-history-pref-changed"),
209 base::FundamentalValue( 209 base::FundamentalValue(
210 profile_->GetPrefs()->GetBoolean( 210 profile_->GetPrefs()->GetBoolean(
211 prefs::kAllowDeletingBrowserHistory))); 211 prefs::kAllowDeletingBrowserHistory)));
212 } 212 }
213 213
214 void ClearBrowsingDataHandler::HandleInitialize(const base::ListValue* args) { 214 void ClearBrowsingDataHandler::HandleInitialize(const base::ListValue* args) {
215 AllowJavascript(); 215 AllowJavascript();
216 216
217 CallJavascriptFunction(
218 "cr.webUIListenerCallback",
219 base::StringValue("clearing-browsing-data"),
220 base::FundamentalValue(!!remover_));
221
217 // TODO(msramek): Simplify this using a factory. 222 // TODO(msramek): Simplify this using a factory.
218 AddCounter(base::WrapUnique(new AutofillCounter())); 223 AddCounter(base::WrapUnique(new AutofillCounter()));
219 AddCounter(base::WrapUnique(new CacheCounter())); 224 AddCounter(base::WrapUnique(new CacheCounter()));
220 AddCounter(base::WrapUnique(new DownloadsCounter())); 225 AddCounter(base::WrapUnique(new DownloadsCounter()));
221 AddCounter(base::WrapUnique(new HistoryCounter())); 226 AddCounter(base::WrapUnique(new HistoryCounter()));
222 AddCounter(base::WrapUnique(new HostedAppsCounter())); 227 AddCounter(base::WrapUnique(new HostedAppsCounter()));
223 AddCounter(base::WrapUnique(new PasswordsCounter())); 228 AddCounter(base::WrapUnique(new PasswordsCounter()));
224 AddCounter(base::WrapUnique(new MediaLicensesCounter())); 229 AddCounter(base::WrapUnique(new MediaLicensesCounter()));
225 230
226 OnStateChanged(); 231 OnStateChanged();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 void ClearBrowsingDataHandler::UpdateCounterText( 290 void ClearBrowsingDataHandler::UpdateCounterText(
286 std::unique_ptr<BrowsingDataCounter::Result> result) { 291 std::unique_ptr<BrowsingDataCounter::Result> result) {
287 CallJavascriptFunction( 292 CallJavascriptFunction(
288 "cr.webUIListenerCallback", 293 "cr.webUIListenerCallback",
289 base::StringValue("update-counter-text"), 294 base::StringValue("update-counter-text"),
290 base::StringValue(result->source()->GetPrefName()), 295 base::StringValue(result->source()->GetPrefName()),
291 base::StringValue(GetCounterTextFromResult(result.get()))); 296 base::StringValue(GetCounterTextFromResult(result.get())));
292 } 297 }
293 298
294 } // namespace settings 299 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698