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

Side by Side Diff: chrome/browser/ui/webui/options/clear_browser_data_handler.cc

Issue 1342093003: Decouple the browsing data counters initialization and start. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added Restart() to tests as well. Created 5 years, 3 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 | « chrome/browser/browsing_data/passwords_counter_browsertest.cc ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/options/clear_browser_data_handler.h" 5 #include "chrome/browser/ui/webui/options/clear_browser_data_handler.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 } 74 }
75 75
76 void ClearBrowserDataHandler::InitializePage() { 76 void ClearBrowserDataHandler::InitializePage() {
77 UpdateInfoBannerVisibility(); 77 UpdateInfoBannerVisibility();
78 OnBrowsingHistoryPrefChanged(); 78 OnBrowsingHistoryPrefChanged();
79 bool removal_in_progress = !!remover_; 79 bool removal_in_progress = !!remover_;
80 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.setClearing", 80 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.setClearing",
81 base::FundamentalValue(removal_in_progress)); 81 base::FundamentalValue(removal_in_progress));
82 82
83 for (BrowsingDataCounter* counter : counters_) {
84 DCHECK(AreCountersEnabled());
85 counter->Restart();
86 }
83 web_ui()->CallJavascriptFunction( 87 web_ui()->CallJavascriptFunction(
84 "ClearBrowserDataOverlay.markInitializationComplete"); 88 "ClearBrowserDataOverlay.markInitializationComplete");
85 } 89 }
86 90
87 void ClearBrowserDataHandler::UpdateInfoBannerVisibility() { 91 void ClearBrowserDataHandler::UpdateInfoBannerVisibility() {
88 base::string16 text; 92 base::string16 text;
89 93
90 Profile* profile = Profile::FromWebUI(web_ui()); 94 Profile* profile = Profile::FromWebUI(web_ui());
91 auto availability = IncognitoModePrefs::GetAvailability(profile->GetPrefs()); 95 auto availability = IncognitoModePrefs::GetAvailability(profile->GetPrefs());
92 if (availability == IncognitoModePrefs::ENABLED) { 96 if (availability == IncognitoModePrefs::ENABLED) {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 ? l10n_util::GetPluralStringFUTF16(text_grd_id, count) 282 ? l10n_util::GetPluralStringFUTF16(text_grd_id, count)
279 : l10n_util::GetStringUTF16(IDS_CLEAR_BROWSING_DATA_CALCULATING); 283 : l10n_util::GetStringUTF16(IDS_CLEAR_BROWSING_DATA_CALCULATING);
280 284
281 web_ui()->CallJavascriptFunction( 285 web_ui()->CallJavascriptFunction(
282 "ClearBrowserDataOverlay.updateCounter", 286 "ClearBrowserDataOverlay.updateCounter",
283 base::StringValue(pref_name), 287 base::StringValue(pref_name),
284 base::StringValue(text)); 288 base::StringValue(text));
285 } 289 }
286 290
287 } // namespace options 291 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/passwords_counter_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698