| OLD | NEW |
| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 9 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| 10 #include "chrome/browser/chromeos/system/timezone_util.h" | 10 #include "chrome/browser/chromeos/system/timezone_util.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 bool system_time_zone_automatic_detection_managed = | 54 bool system_time_zone_automatic_detection_managed = |
| 55 IsSystemTimezoneAutomaticDetectionManaged(); | 55 IsSystemTimezoneAutomaticDetectionManaged(); |
| 56 html_source->AddBoolean("systemTimeZoneDetectionManaged", | 56 html_source->AddBoolean("systemTimeZoneDetectionManaged", |
| 57 system_time_zone_automatic_detection_managed); | 57 system_time_zone_automatic_detection_managed); |
| 58 if (system_time_zone_automatic_detection_managed) { | 58 if (system_time_zone_automatic_detection_managed) { |
| 59 html_source->AddInteger("systemTimeZoneDetectionPolicyValue", | 59 html_source->AddInteger("systemTimeZoneDetectionPolicyValue", |
| 60 GetSystemTimezoneAutomaticDetectionPolicyValue()); | 60 GetSystemTimezoneAutomaticDetectionPolicyValue()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 64 chromeos::switches::kDisableTimeZoneTrackingOption)) { | |
| 65 html_source->AddBoolean("hideTimeZoneDetection", true); | |
| 66 } | |
| 67 | |
| 68 return new DateTimeHandler; | 63 return new DateTimeHandler; |
| 69 } | 64 } |
| 70 | 65 |
| 71 void DateTimeHandler::RegisterMessages() { | 66 void DateTimeHandler::RegisterMessages() { |
| 72 // TODO(michaelpg): Add time zone message handlers. | 67 // TODO(michaelpg): Add time zone message handlers. |
| 73 } | 68 } |
| 74 | 69 |
| 75 void DateTimeHandler::OnJavascriptAllowed() { | 70 void DateTimeHandler::OnJavascriptAllowed() { |
| 76 // TODO(michaelpg): Add policy observers. | 71 // TODO(michaelpg): Add policy observers. |
| 77 } | 72 } |
| 78 | 73 |
| 79 void DateTimeHandler::OnJavascriptDisallowed() { | 74 void DateTimeHandler::OnJavascriptDisallowed() { |
| 80 // TODO(michaelpg): Remove policy observers. | 75 // TODO(michaelpg): Remove policy observers. |
| 81 } | 76 } |
| 82 | 77 |
| 83 } // namespace settings | 78 } // namespace settings |
| 84 } // namespace chromeos | 79 } // namespace chromeos |
| OLD | NEW |