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

Side by Side Diff: chrome/browser/chromeos/cros/brightness_library.h

Issue 7493061: cros: Apply the Init() model to BrightnessLibrary API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BRIGHTNESS_LIBRARY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_ 6 #define CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_
7 #pragma once 7 #pragma once
8 8
9 namespace chromeos { 9 namespace chromeos {
10 10
11 class BrightnessLibrary { 11 class BrightnessLibrary {
12 public: 12 public:
13 class Observer { 13 class Observer {
14 public: 14 public:
15 virtual void BrightnessChanged(int level, bool user_initiated) = 0; 15 virtual void BrightnessChanged(int level, bool user_initiated) = 0;
16 }; 16 };
17 17
18 virtual ~BrightnessLibrary() {} 18 virtual ~BrightnessLibrary() {}
19 19
20 virtual void Init() = 0;
21
22 virtual void AddObserver(Observer* observer) = 0;
23 virtual void RemoveObserver(Observer* observer) = 0;
24
20 virtual void DecreaseScreenBrightness(bool allow_off) = 0; 25 virtual void DecreaseScreenBrightness(bool allow_off) = 0;
21 virtual void IncreaseScreenBrightness() = 0; 26 virtual void IncreaseScreenBrightness() = 0;
22 27
23 virtual void AddObserver(Observer* observer) = 0;
24 virtual void RemoveObserver(Observer* observer) = 0;
25
26 // Factory function, creates a new instance and returns ownership. 28 // Factory function, creates a new instance and returns ownership.
27 // For normal usage, access the singleton via CrosLibrary::Get(). 29 // For normal usage, access the singleton via CrosLibrary::Get().
28 static BrightnessLibrary* GetImpl(bool stub); 30 static BrightnessLibrary* GetImpl(bool stub);
29 }; 31 };
30 32
31 } // namespace chromeos 33 } // namespace chromeos
32 34
33 #endif // CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_ 35 #endif // CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/brightness_library.cc » ('j') | chrome/browser/chromeos/cros/brightness_library.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698