summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/cros
diff options
context:
space:
mode:
authorsque@chromium.org <sque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 23:26:49 +0000
committersque@chromium.org <sque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-22 23:26:49 +0000
commita329ebef8b04274d832bda57c6d3d108d5f4e9ce (patch)
treeede9cf88f92ada61e7caa430d6b9de2bbe796ad9 /chrome/browser/chromeos/cros
parent2505827b3cb1a71414e2d70c8149ecb0fed8d925 (diff)
downloadchromium_src-a329ebef8b04274d832bda57c6d3d108d5f4e9ce.zip
chromium_src-a329ebef8b04274d832bda57c6d3d108d5f4e9ce.tar.gz
chromium_src-a329ebef8b04274d832bda57c6d3d108d5f4e9ce.tar.bz2
chromeos: Move EnableScreenLock to PowerManagerClient from PowerLibrary
Part of libcros removal. Directly writing to the prefs file, instead of going thru libcros. BUG=chromium-os:16558 TEST=Go to VT2 and make sure /var/lib/power_manager/lock_on_idle_suspend does not exist (delete if it does). Type 'stop powerd'. Sign in as a user. Press power button to lock screen. Go to VT2 and look at /var/lib/power_manager/lock_on_idle_suspend. The file should have been created. Signed-off-by: Simon Que <sque@chromium.org> R=satorux@chromium.org,stevenjb@chromium.org Review URL: http://codereview.chromium.org/8573025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111248 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/cros')
-rw-r--r--chrome/browser/chromeos/cros/cros_mock.cc4
-rw-r--r--chrome/browser/chromeos/cros/mock_power_library.h2
-rw-r--r--chrome/browser/chromeos/cros/power_library.cc16
-rw-r--r--chrome/browser/chromeos/cros/power_library.h3
4 files changed, 0 insertions, 25 deletions
diff --git a/chrome/browser/chromeos/cros/cros_mock.cc b/chrome/browser/chromeos/cros/cros_mock.cc
index d468ff7..36e310e 100644
--- a/chrome/browser/chromeos/cros/cros_mock.cc
+++ b/chrome/browser/chromeos/cros/cros_mock.cc
@@ -230,10 +230,6 @@ void CrosMock::SetPowerLibraryStatusAreaExpectations() {
}
void CrosMock::SetPowerLibraryExpectations() {
- // EnableScreenLock is currently bounded with a prefs value and thus is
- // always called when loading
- EXPECT_CALL(*mock_power_library_, EnableScreenLock(_))
- .Times(AnyNumber());
}
void CrosMock::TearDownMocks() {
diff --git a/chrome/browser/chromeos/cros/mock_power_library.h b/chrome/browser/chromeos/cros/mock_power_library.h
index 2f9af6f..cd4d0a1 100644
--- a/chrome/browser/chromeos/cros/mock_power_library.h
+++ b/chrome/browser/chromeos/cros/mock_power_library.h
@@ -21,8 +21,6 @@ class MockPowerLibrary : public PowerLibrary {
MOCK_METHOD1(AddObserver, void(Observer*));
MOCK_METHOD1(RemoveObserver, void(Observer*));
-
- MOCK_METHOD1(EnableScreenLock, void(bool));
};
} // namespace chromeos
diff --git a/chrome/browser/chromeos/cros/power_library.cc b/chrome/browser/chromeos/cros/power_library.cc
index ad46f69..878c735 100644
--- a/chrome/browser/chromeos/cros/power_library.cc
+++ b/chrome/browser/chromeos/cros/power_library.cc
@@ -48,23 +48,9 @@ class PowerLibraryImpl : public PowerLibrary {
observers_.RemoveObserver(observer);
}
- virtual void EnableScreenLock(bool enable) OVERRIDE {
- // Called when the screen preference is changed, which should always
- // run on UI thread.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- // Post the task to FILE thread as chromeos::EnableScreenLock
- // would write power manager config file to disk.
- BrowserThread::PostTask(
- BrowserThread::FILE, FROM_HERE,
- base::Bind(&PowerLibraryImpl::DoEnableScreenLock, enable));
- }
-
// End PowerLibrary implementation.
private:
- static void DoEnableScreenLock(bool enable) {
- chromeos::EnableScreenLock(enable);
- }
static void SystemResumedHandler(void* object) {
PowerLibraryImpl* power = static_cast<PowerLibraryImpl*>(object);
@@ -105,8 +91,6 @@ class PowerLibraryStubImpl : public PowerLibrary {
observers_.RemoveObserver(observer);
}
- virtual void EnableScreenLock(bool enable) OVERRIDE {}
-
// End PowerLibrary implementation.
private:
ObserverList<Observer> observers_;
diff --git a/chrome/browser/chromeos/cros/power_library.h b/chrome/browser/chromeos/cros/power_library.h
index a5aa285..d732ef6 100644
--- a/chrome/browser/chromeos/cros/power_library.h
+++ b/chrome/browser/chromeos/cros/power_library.h
@@ -32,9 +32,6 @@ class PowerLibrary {
virtual void AddObserver(Observer* observer) = 0;
virtual void RemoveObserver(Observer* observer) = 0;
- // Enable/disable screen lock for current session.
- virtual void EnableScreenLock(bool enable) = 0;
-
// Factory function, creates a new instance and returns ownership.
// For normal usage, access the singleton via CrosLibrary::Get().
static PowerLibrary* GetImpl(bool stub);