[DeviceOffHours] Code refactoring

Desktop / Chromium - Daria Yakovleva [google.com] - 12 October 2017 17:22 EDT

Split functions from device_off_hours_controller into different files and put them to off_hours namespace.

ApplyOffHoursPolicyToProto(..) -> off_hours_policy_applier

ConvertOffHoursProtoToValue(..) -> off_hours_proto_parser ExtractWeeklyTimeFromProto(..) -> off_hours_proto_parser ExtractIntervalsFromProto(..) -> off_hours_proto_parser ExtractIgnoredPolicyProtoTagsFromProto(..) -> off_hours_proto_parser ExtractTimezoneFromProto(..) -> off_hours_proto_parser

GetOffsetFromTimezoneToGmt(..) -> time_utils ConvertIntervalsToGmt(..) -> time_utils GetDeltaTillNextOffHours(..) -> time_utils

Bug: 739713 Change-Id: Id489eb22c9b8d73ab030b3698898dcb25d6806d1 Reviewed-on: https://chromium-review.googlesource.com/690197 Commit-Queue: Daria Iakovleva

2857396 [DeviceOffHours] Code refactoring
chrome/browser/chromeos/BUILD.gn | 12 +-
.../chromeos/policy/device_off_hours_controller.cc | 349 ---------------------
.../policy/device_policy_decoder_chromeos.cc | 4 +-
.../off_hours/device_off_hours_controller.cc | 179 +++++++++++
.../{ => off_hours}/device_off_hours_controller.h | 37 +--
.../device_off_hours_controller_unittest.cc | 6 +-
.../policy/off_hours/off_hours_policy_applier.cc | 30 ++
.../policy/off_hours/off_hours_policy_applier.h | 25 ++
.../policy/off_hours/off_hours_proto_parser.cc | 94 ++++++
.../policy/off_hours/off_hours_proto_parser.h | 58 ++++
.../chromeos/policy/off_hours/time_utils.cc | 86 +++++
.../browser/chromeos/policy/off_hours/time_utils.h | 35 +++
.../chromeos/settings/device_settings_provider.cc | 6 +-
.../chromeos/settings/device_settings_service.cc | 9 +-
.../chromeos/settings/device_settings_service.h | 11 +-
chrome/browser/ui/ash/session_controller_client.cc | 2 +-
chrome/browser/ui/ash/session_controller_client.h | 4 +-
17 files changed, 547 insertions(+), 400 deletions(-)

Upstream: git.chromium.org


  • Share