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_
10 #include "base/strings/string16.h"
11 #include "chromeos/settings/cros_settings_provider.h"
12 #include "third_party/icu/source/i18n/unicode/timezone.h"
17 // This interface provides access to Chrome OS timezone settings.
18 class CHROMEOS_EXPORT TimezoneSettings
{
22 // Called when the timezone has changed. |timezone| is non-null.
23 virtual void TimezoneChanged(const icu::TimeZone
& timezone
) = 0;
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
);
47 virtual ~TimezoneSettings() {}
51 } // namespace chromeos
53 #endif // CHROMEOS_SETTINGS_TIMEZONE_SETTINGS_H_