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

Side by Side Diff: chrome/browser/chromeos/dbus/power_manager_client.h

Issue 8664014: chromeos: move screen lock handling to power manager client (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebased Created 9 years 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) 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_DBUS_POWER_MANAGER_CLIENT_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
6 #define CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ 6 #define CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // |level| is of the range [0, 100]. 47 // |level| is of the range [0, 100].
48 // |user_initiated| is true if the action is initiated by the user. 48 // |user_initiated| is true if the action is initiated by the user.
49 virtual void BrightnessChanged(int level, bool user_initiated) {} 49 virtual void BrightnessChanged(int level, bool user_initiated) {}
50 50
51 // Called when power supply polling takes place. |status| is a data 51 // Called when power supply polling takes place. |status| is a data
52 // structure that contains the current state of the power supply. 52 // structure that contains the current state of the power supply.
53 virtual void PowerChanged(const PowerSupplyStatus& status) {} 53 virtual void PowerChanged(const PowerSupplyStatus& status) {}
54 54
55 // Called when the system resumes from suspend. 55 // Called when the system resumes from suspend.
56 virtual void SystemResumed() {} 56 virtual void SystemResumed() {}
57
58 // Called when the screen is locked.
59 virtual void LockScreen() {}
60
61 // Called when the screen is unlocked.
62 virtual void UnlockScreen() {}
63
64 // Called when the screen fails to unlock.
65 virtual void UnlockScreenFailed() {}
57 }; 66 };
58 67
59 // Adds and removes the observer. 68 // Adds and removes the observer.
60 virtual void AddObserver(Observer* observer) = 0; 69 virtual void AddObserver(Observer* observer) = 0;
61 virtual void RemoveObserver(Observer* observer) = 0; 70 virtual void RemoveObserver(Observer* observer) = 0;
62 71
63 // Decreases the screen brightness. |allow_off| controls whether or not 72 // Decreases the screen brightness. |allow_off| controls whether or not
64 // it's allowed to turn off the back light. 73 // it's allowed to turn off the back light.
65 virtual void DecreaseScreenBrightness(bool allow_off) = 0; 74 virtual void DecreaseScreenBrightness(bool allow_off) = 0;
66 75
67 // Increases the screen brightness. 76 // Increases the screen brightness.
68 virtual void IncreaseScreenBrightness() = 0; 77 virtual void IncreaseScreenBrightness() = 0;
69 78
70 // UI initiated request for power supply status update. 79 // UI initiated request for power supply status update.
71 virtual void RequestStatusUpdate() = 0; 80 virtual void RequestStatusUpdate() = 0;
72 81
73 // Requests restart of the system. 82 // Requests restart of the system.
74 virtual void RequestRestart() = 0; 83 virtual void RequestRestart() = 0;
75 84
76 // Requests shutdown of the system. 85 // Requests shutdown of the system.
77 virtual void RequestShutdown() = 0; 86 virtual void RequestShutdown() = 0;
78 87
79 // Calculates idle time asynchronously, after the idle time request has 88 // Calculates idle time asynchronously, after the idle time request has
80 // replied. It passes the idle time in seconds to |callback|. If it 89 // replied. It passes the idle time in seconds to |callback|. If it
81 // encounters some error, it passes -1 to |callback|. 90 // encounters some error, it passes -1 to |callback|.
82 virtual void CalculateIdleTime(const CalculateIdleTimeCallback& callback) = 0; 91 virtual void CalculateIdleTime(const CalculateIdleTimeCallback& callback) = 0;
83 92
93 // Notifies PowerManager that a user requested to lock the screen.
94 virtual void NotifyScreenLockRequested() = 0;
95
96 // Notifies PowerManager that screen lock has been completed.
97 virtual void NotifyScreenLockCompleted() = 0;
98
99 // Notifies PowerManager that a user unlocked the screen.
100 virtual void NotifyScreenUnlockRequested() = 0;
101
102 // Notifies PowerManager that screen is unlocked.
103 virtual void NotifyScreenUnlockCompleted() = 0;
104
84 // Creates the instance. 105 // Creates the instance.
85 static PowerManagerClient* Create(dbus::Bus* bus); 106 static PowerManagerClient* Create(dbus::Bus* bus);
86 107
87 virtual ~PowerManagerClient(); 108 virtual ~PowerManagerClient();
88 109
89 protected: 110 protected:
90 // Create() should be used instead. 111 // Create() should be used instead.
91 PowerManagerClient(); 112 PowerManagerClient();
92 113
93 private: 114 private:
94 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); 115 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient);
95 }; 116 };
96 117
97 } // namespace chromeos 118 } // namespace chromeos
98 119
99 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ 120 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/dbus/mock_power_manager_client.h ('k') | chrome/browser/chromeos/dbus/power_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698