forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
system_settings_provider.h
53 lines (40 loc) · 1.63 KB
/
system_settings_provider.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_SETTINGS_SYSTEM_SETTINGS_PROVIDER_H_
#define CHROMEOS_SETTINGS_SYSTEM_SETTINGS_PROVIDER_H_
#include <memory>
#include <string>
#include "base/callback.h"
#include "base/component_export.h"
#include "base/macros.h"
#include "chromeos/settings/cros_settings_provider.h"
#include "chromeos/settings/timezone_settings.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
namespace base {
class Value;
}
namespace chromeos {
class COMPONENT_EXPORT(CHROMEOS_SETTINGS) SystemSettingsProvider
: public CrosSettingsProvider,
public system::TimezoneSettings::Observer {
public:
SystemSettingsProvider();
explicit SystemSettingsProvider(const NotifyObserversCallback& notify_cb);
~SystemSettingsProvider() override;
// CrosSettingsProvider implementation.
const base::Value* Get(const std::string& path) const override;
TrustedStatus PrepareTrustedValues(base::OnceClosure* callback) override;
bool HandlesSetting(const std::string& path) const override;
// TimezoneSettings::Observer implementation.
void TimezoneChanged(const icu::TimeZone& timezone) override;
private:
// Code common to both constructors.
void Init();
std::unique_ptr<base::Value> timezone_value_;
std::unique_ptr<base::Value> per_user_timezone_enabled_value_;
std::unique_ptr<base::Value> fine_grained_time_zone_enabled_value_;
DISALLOW_COPY_AND_ASSIGN(SystemSettingsProvider);
};
} // namespace chromeos
#endif // CHROMEOS_SETTINGS_SYSTEM_SETTINGS_PROVIDER_H_