Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/browser/chromeos/system/timezone_settings.h

Issue 10689175: Refactored code for timezone settings. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added comment referring to initialization in ui.conf. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_SETTINGS_H_
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_SETTINGS_H_ 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_SETTINGS_H_
7 7
8 #include <string> 8 #include <vector>
9 9
10 #include "base/string16.h"
10 #include "chrome/browser/cancelable_request.h" 11 #include "chrome/browser/cancelable_request.h"
11 #include "unicode/timezone.h" 12 #include "unicode/timezone.h"
12 13
13 namespace chromeos { 14 namespace chromeos {
14 namespace system { 15 namespace system {
15 16
16 // This interface provides access to Chrome OS timezone settings. 17 // This interface provides access to Chrome OS timezone settings.
17 class TimezoneSettings : public CancelableRequestProvider { 18 class TimezoneSettings : public CancelableRequestProvider {
18 public: 19 public:
19 class Observer { 20 class Observer {
Joao da Silva 2012/07/12 18:34:09 Please add a virtual destructor to this, with an e
pneubeck2 2012/07/13 10:31:39 Done.
20 public: 21 public:
21 // Called when the timezone has changed. |timezone| is non-null. 22 // Called when the timezone has changed. |timezone| is non-null.
22 virtual void TimezoneChanged(const icu::TimeZone& timezone) = 0; 23 virtual void TimezoneChanged(const icu::TimeZone& timezone) = 0;
23 }; 24 };
24 25
25 static TimezoneSettings* GetInstance(); 26 static TimezoneSettings* GetInstance();
26 27
27 // Returns the current timezone as an icu::Timezone object. 28 // Returns the current timezone as an icu::Timezone object.
28 virtual const icu::TimeZone& GetTimezone() = 0; 29 virtual const icu::TimeZone& GetTimezone() = 0;
30 virtual const string16 GetCurrentTimezoneID() = 0;
Joao da Silva 2012/07/12 18:34:09 No need for const when returning a value.
pneubeck2 2012/07/13 10:31:39 Done.
29 31
30 // Sets the current timezone. |timezone| must be non-null. 32 // Sets the current timezone and notifies all Observers.
31 virtual void SetTimezone(const icu::TimeZone& timezone) = 0; 33 virtual void SetTimezone(const icu::TimeZone& timezone) = 0;
34 virtual void SetTimezoneFromID(const string16& timezone_id) = 0;
32 35
33 virtual void AddObserver(Observer* observer) = 0; 36 virtual void AddObserver(Observer* observer) = 0;
34 virtual void RemoveObserver(Observer* observer) = 0; 37 virtual void RemoveObserver(Observer* observer) = 0;
35 38
39 virtual const std::vector<icu::TimeZone*> &GetTimezoneList() const = 0;
Joao da Silva 2012/07/12 18:34:09 Nit: move the & next to the type
pneubeck2 2012/07/13 10:31:39 Done.
40
41 // Gets timezone ID which is also used as timezone pref value.
42 static string16 GetTimezoneID(const icu::TimeZone& timezone);
43
36 protected: 44 protected:
37 virtual ~TimezoneSettings() {} 45 virtual ~TimezoneSettings() {}
38 }; 46 };
39 47
40 } // namespace system 48 } // namespace system
41 } // namespace chromeos 49 } // namespace chromeos
42 50
43 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_SETTINGS_H_ 51 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698