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

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

Issue 2849823003: ChromeOS: implement per-user time zone preferences. (Closed)
Patch Set: Rebased. Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chromeos/date_time_handler.h" 5 #include "chrome/browser/ui/webui/settings/chromeos/date_time_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 html_source->AddString( 82 html_source->AddString(
83 "timeZoneID", 83 "timeZoneID",
84 system::TimezoneSettings::GetInstance()->GetCurrentTimezoneID()); 84 system::TimezoneSettings::GetInstance()->GetCurrentTimezoneID());
85 85
86 if (!IsTimezoneAutomaticDetectionUserEditable()) { 86 if (!IsTimezoneAutomaticDetectionUserEditable()) {
87 html_source->AddBoolean("timeZoneAutoDetectValueFromPolicy", 87 html_source->AddBoolean("timeZoneAutoDetectValueFromPolicy",
88 g_browser_process->platform_part() 88 g_browser_process->platform_part()
89 ->GetTimezoneResolverManager() 89 ->GetTimezoneResolverManager()
90 ->ShouldApplyResolvedTimezone()); 90 ->ShouldApplyResolvedTimezone());
91 } 91 }
92 html_source->AddBoolean("perUserTimezoneEnabled",
93 system::PerUserTimezoneEnabled());
92 94
93 return new DateTimeHandler; 95 return new DateTimeHandler;
94 } 96 }
95 97
96 void DateTimeHandler::RegisterMessages() { 98 void DateTimeHandler::RegisterMessages() {
97 web_ui()->RegisterMessageCallback( 99 web_ui()->RegisterMessageCallback(
98 "dateTimePageReady", base::Bind(&DateTimeHandler::HandleDateTimePageReady, 100 "dateTimePageReady", base::Bind(&DateTimeHandler::HandleDateTimePageReady,
99 base::Unretained(this))); 101 base::Unretained(this)));
100 web_ui()->RegisterMessageCallback( 102 web_ui()->RegisterMessageCallback(
101 "getTimeZones", 103 "getTimeZones",
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 FireWebUIListener("time-zone-auto-detect-policy", base::Value(managed), 175 FireWebUIListener("time-zone-auto-detect-policy", base::Value(managed),
174 base::Value(force_enabled)); 176 base::Value(force_enabled));
175 } 177 }
176 178
177 void DateTimeHandler::SystemClockCanSetTimeChanged(bool can_set_time) { 179 void DateTimeHandler::SystemClockCanSetTimeChanged(bool can_set_time) {
178 FireWebUIListener("can-set-date-time-changed", base::Value(can_set_time)); 180 FireWebUIListener("can-set-date-time-changed", base::Value(can_set_time));
179 } 181 }
180 182
181 } // namespace settings 183 } // namespace settings
182 } // namespace chromeos 184 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698