blob: 46fe65adea3f6e5f7ebc39b3cd059cf1e274d488 [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
Gilad Arnold48415f12014-06-27 07:10:58 -07005#ifndef UPDATE_ENGINE_UPDATE_MANAGER_TIME_PROVIDER_H_
6#define UPDATE_ENGINE_UPDATE_MANAGER_TIME_PROVIDER_H_
Gilad Arnold78a78112014-03-13 14:58:06 -07007
Alex Vakulenko75039d72014-03-25 12:36:28 -07008#include <base/time/time.h>
Gilad Arnold78a78112014-03-13 14:58:06 -07009
Alex Deymo63784a52014-05-28 10:46:14 -070010#include "update_engine/update_manager/provider.h"
11#include "update_engine/update_manager/variable.h"
Gilad Arnold78a78112014-03-13 14:58:06 -070012
Alex Deymo63784a52014-05-28 10:46:14 -070013namespace chromeos_update_manager {
Gilad Arnold78a78112014-03-13 14:58:06 -070014
15// Provider for time related information.
16class TimeProvider : public Provider {
17 public:
David Zeuthen21716e22014-04-23 15:42:05 -070018 virtual ~TimeProvider() {}
19
Gilad Arnold78a78112014-03-13 14:58:06 -070020 // Returns the current date. The time of day component will be zero.
David Zeuthen21716e22014-04-23 15:42:05 -070021 virtual Variable<base::Time>* var_curr_date() = 0;
Gilad Arnold78a78112014-03-13 14:58:06 -070022
23 // Returns the current hour (0 to 23) in local time. The type is int to keep
24 // consistent with base::Time.
David Zeuthen21716e22014-04-23 15:42:05 -070025 virtual Variable<int>* var_curr_hour() = 0;
Gilad Arnold78a78112014-03-13 14:58:06 -070026
Gilad Arnold78a78112014-03-13 14:58:06 -070027 protected:
28 TimeProvider() {}
29
Gilad Arnold78a78112014-03-13 14:58:06 -070030 private:
Gilad Arnold78a78112014-03-13 14:58:06 -070031 DISALLOW_COPY_AND_ASSIGN(TimeProvider);
32};
33
Alex Deymo63784a52014-05-28 10:46:14 -070034} // namespace chromeos_update_manager
Gilad Arnold78a78112014-03-13 14:58:06 -070035
Gilad Arnold48415f12014-06-27 07:10:58 -070036#endif // UPDATE_ENGINE_UPDATE_MANAGER_TIME_PROVIDER_H_