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

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

Issue 1008333002: Move time constants to base::Time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments#3 Created 5 years, 9 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/chromeos/policy/device_status_collector.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/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 web_ui()->CallJavascriptFunction( 61 web_ui()->CallJavascriptFunction(
62 "ClearBrowserDataOverlay.markInitializationComplete"); 62 "ClearBrowserDataOverlay.markInitializationComplete");
63 } 63 }
64 64
65 void ClearBrowserDataHandler::UpdateInfoBannerVisibility() { 65 void ClearBrowserDataHandler::UpdateInfoBannerVisibility() {
66 Profile* profile = Profile::FromWebUI(web_ui()); 66 Profile* profile = Profile::FromWebUI(web_ui());
67 base::Time lastClearBrowsingDataTime = base::Time::FromInternalValue( 67 base::Time lastClearBrowsingDataTime = base::Time::FromInternalValue(
68 profile->GetPrefs()->GetInt64(prefs::kLastClearBrowsingDataTime)); 68 profile->GetPrefs()->GetInt64(prefs::kLastClearBrowsingDataTime));
69 69
70 const int64 kHoursPerDay = 24;
71 bool visible = (base::Time::Now() - lastClearBrowsingDataTime) <= 70 bool visible = (base::Time::Now() - lastClearBrowsingDataTime) <=
72 base::TimeDelta::FromHours(kHoursPerDay); 71 base::TimeDelta::FromHours(base::Time::kHoursPerDay);
73 72
74 base::ListValue args; 73 base::ListValue args;
75 args.AppendBoolean(visible); 74 args.AppendBoolean(visible);
76 web_ui()->CallJavascriptFunction( 75 web_ui()->CallJavascriptFunction(
77 "ClearBrowserDataOverlay.setBannerVisibility", args); 76 "ClearBrowserDataOverlay.setBannerVisibility", args);
78 } 77 }
79 78
80 void ClearBrowserDataHandler::GetLocalizedValues( 79 void ClearBrowserDataHandler::GetLocalizedValues(
81 base::DictionaryValue* localized_strings) { 80 base::DictionaryValue* localized_strings) {
82 DCHECK(localized_strings); 81 DCHECK(localized_strings);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing"); 212 web_ui()->CallJavascriptFunction("ClearBrowserDataOverlay.doneClearing");
214 } 213 }
215 214
216 void ClearBrowserDataHandler::OnBrowsingHistoryPrefChanged() { 215 void ClearBrowserDataHandler::OnBrowsingHistoryPrefChanged() {
217 web_ui()->CallJavascriptFunction( 216 web_ui()->CallJavascriptFunction(
218 "ClearBrowserDataOverlay.setAllowDeletingHistory", 217 "ClearBrowserDataOverlay.setAllowDeletingHistory",
219 base::FundamentalValue(*allow_deleting_browser_history_)); 218 base::FundamentalValue(*allow_deleting_browser_history_));
220 } 219 }
221 220
222 } // namespace options 221 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/policy/device_status_collector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698