| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CROS_SYSTEM_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_SYSTEM_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_SYSTEM_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_SYSTEM_LIBRARY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 virtual ~SystemLibrary() {} | 26 virtual ~SystemLibrary() {} |
| 27 | 27 |
| 28 virtual void AddObserver(Observer* observer) = 0; | 28 virtual void AddObserver(Observer* observer) = 0; |
| 29 virtual void RemoveObserver(Observer* observer) = 0; | 29 virtual void RemoveObserver(Observer* observer) = 0; |
| 30 | 30 |
| 31 // Returns the current timezone as an icu::Timezone object. | 31 // Returns the current timezone as an icu::Timezone object. |
| 32 virtual const icu::TimeZone& GetTimezone() = 0; | 32 virtual const icu::TimeZone& GetTimezone() = 0; |
| 33 | 33 |
| 34 // Sets the current timezone. |timezone| must be non-null. | 34 // Sets the current timezone. |timezone| must be non-null. |
| 35 virtual void SetTimezone(const icu::TimeZone* timezone) = 0; | 35 virtual void SetTimezone(const icu::TimeZone* timezone) = 0; |
| 36 }; | |
| 37 | 36 |
| 38 // This class handles the interaction with the ChromeOS syslogs APIs. | 37 // Get library implementation. |
| 39 class SystemLibraryImpl : public SystemLibrary { | 38 static SystemLibrary* GetImpl(bool stub); |
| 40 public: | |
| 41 SystemLibraryImpl(); | |
| 42 virtual ~SystemLibraryImpl() {} | |
| 43 | |
| 44 // NetworkLibrary overrides. | |
| 45 virtual void AddObserver(Observer* observer); | |
| 46 virtual void RemoveObserver(Observer* observer); | |
| 47 | |
| 48 virtual const icu::TimeZone& GetTimezone(); | |
| 49 virtual void SetTimezone(const icu::TimeZone*); | |
| 50 | |
| 51 private: | |
| 52 scoped_ptr<icu::TimeZone> timezone_; | |
| 53 ObserverList<Observer> observers_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(SystemLibraryImpl); | |
| 56 }; | 39 }; |
| 57 | 40 |
| 58 } // namespace chromeos | 41 } // namespace chromeos |
| 59 | 42 |
| 60 #endif // CHROME_BROWSER_CHROMEOS_CROS_SYSTEM_LIBRARY_H_ | 43 #endif // CHROME_BROWSER_CHROMEOS_CROS_SYSTEM_LIBRARY_H_ |
| OLD | NEW |