blob: 8349c01ba7ac443ee4f2dace7db039a463b4cebb [file] [log] [blame]
Gilad Arnold78a78112014-03-13 14:58:06 -07001// Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_TIME_PROVIDER_H_
6#define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_TIME_PROVIDER_H_
7
8#include <base/memory/scoped_ptr.h>
Alex Vakulenko75039d72014-03-25 12:36:28 -07009#include <base/time/time.h>
Gilad Arnold78a78112014-03-13 14:58:06 -070010
11#include "update_engine/policy_manager/provider.h"
12#include "update_engine/policy_manager/variable.h"
13
14namespace chromeos_policy_manager {
15
16// Provider for time related information.
17class TimeProvider : public Provider {
18 public:
David Zeuthen21716e22014-04-23 15:42:05 -070019 virtual ~TimeProvider() {}
20
Gilad Arnold78a78112014-03-13 14:58:06 -070021 // Returns the current date. The time of day component will be zero.
David Zeuthen21716e22014-04-23 15:42:05 -070022 virtual Variable<base::Time>* var_curr_date() = 0;
Gilad Arnold78a78112014-03-13 14:58:06 -070023
24 // Returns the current hour (0 to 23) in local time. The type is int to keep
25 // consistent with base::Time.
David Zeuthen21716e22014-04-23 15:42:05 -070026 virtual Variable<int>* var_curr_hour() = 0;
Gilad Arnold78a78112014-03-13 14:58:06 -070027
28 // TODO(garnold) Implement a method/variable for querying whether a given
29 // point in time was reached.
30
31 protected:
32 TimeProvider() {}
33
Gilad Arnold78a78112014-03-13 14:58:06 -070034 private:
Gilad Arnold78a78112014-03-13 14:58:06 -070035 DISALLOW_COPY_AND_ASSIGN(TimeProvider);
36};
37
38} // namespace chromeos_policy_manager
39
40#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_TIME_PROVIDER_H_