Less strict CHECK for DeviceCapabilities results.
[chromium-blink-merge.git] / chromeos / settings / timezone_settings.h
blob0fd7b3d01a48587f6f2f6c8996cfc559c831a34c
1 // Copyright 2013 The Chromium 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.
5 #ifndef CHROMEOS_SETTINGS_TIMEZONE_SETTINGS_H_
6 #define CHROMEOS_SETTINGS_TIMEZONE_SETTINGS_H_
8 #include <vector>
10 #include "base/strings/string16.h"
11 #include "chromeos/settings/cros_settings_provider.h"
12 #include "third_party/icu/source/i18n/unicode/timezone.h"
14 namespace chromeos {
15 namespace system {
17 // This interface provides access to Chrome OS timezone settings.
18 class CHROMEOS_EXPORT TimezoneSettings {
19 public:
20 class Observer {
21 public:
22 // Called when the timezone has changed. |timezone| is non-null.
23 virtual void TimezoneChanged(const icu::TimeZone& timezone) = 0;
24 protected:
25 virtual ~Observer();
28 static TimezoneSettings* GetInstance();
30 // Returns the current timezone as an icu::Timezone object.
31 virtual const icu::TimeZone& GetTimezone() = 0;
32 virtual base::string16 GetCurrentTimezoneID() = 0;
34 // Sets the current timezone and notifies all Observers.
35 virtual void SetTimezone(const icu::TimeZone& timezone) = 0;
36 virtual void SetTimezoneFromID(const base::string16& timezone_id) = 0;
38 virtual void AddObserver(Observer* observer) = 0;
39 virtual void RemoveObserver(Observer* observer) = 0;
41 virtual const std::vector<icu::TimeZone*>& GetTimezoneList() const = 0;
43 // Gets timezone ID which is also used as timezone pref value.
44 static base::string16 GetTimezoneID(const icu::TimeZone& timezone);
46 protected:
47 virtual ~TimezoneSettings() {}
50 } // namespace system
51 } // namespace chromeos
53 #endif // CHROMEOS_SETTINGS_TIMEZONE_SETTINGS_H_