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

Side by Side Diff: chromeos/power/power_state_override.cc

Issue 12260029: chromeos: Don't override suspend-on-lid-closed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 7 years, 10 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
« no previous file with comments | « chromeos/power/power_state_override.h ('k') | chromeos/power/power_state_override_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chromeos/power/power_state_override.h" 5 #include "chromeos/power/power_state_override.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "chromeos/dbus/dbus_thread_manager.h" 10 #include "chromeos/dbus/dbus_thread_manager.h"
(...skipping 17 matching lines...) Expand all
28 PowerStateOverride::PowerStateOverride(Mode mode) 28 PowerStateOverride::PowerStateOverride(Mode mode)
29 : override_types_(0), 29 : override_types_(0),
30 request_id_(0), 30 request_id_(0),
31 dbus_thread_manager_(DBusThreadManager::Get()) { 31 dbus_thread_manager_(DBusThreadManager::Get()) {
32 switch (mode) { 32 switch (mode) {
33 case BLOCK_DISPLAY_SLEEP: 33 case BLOCK_DISPLAY_SLEEP:
34 override_types_ |= (PowerManagerClient::DISABLE_IDLE_DIM | 34 override_types_ |= (PowerManagerClient::DISABLE_IDLE_DIM |
35 PowerManagerClient::DISABLE_IDLE_BLANK); 35 PowerManagerClient::DISABLE_IDLE_BLANK);
36 // fallthrough 36 // fallthrough
37 case BLOCK_SYSTEM_SUSPEND: 37 case BLOCK_SYSTEM_SUSPEND:
38 override_types_ |= (PowerManagerClient::DISABLE_IDLE_SUSPEND | 38 override_types_ |= PowerManagerClient::DISABLE_IDLE_SUSPEND;
39 PowerManagerClient::DISABLE_IDLE_LID_SUSPEND);
40 break; 39 break;
41 default: 40 default:
42 NOTREACHED() << "Unhandled mode " << mode; 41 NOTREACHED() << "Unhandled mode " << mode;
43 } 42 }
44 43
45 dbus_thread_manager_->AddObserver(this); 44 dbus_thread_manager_->AddObserver(this);
46 45
47 // request_id_ = 0 will create a new override request. 46 // request_id_ = 0 will create a new override request.
48 // We do a post task here to ensure that this request runs 'after' our 47 // We do a post task here to ensure that this request runs 'after' our
49 // constructor is done. If not, there is a possibility (though only in 48 // constructor is done. If not, there is a possibility (though only in
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 void PowerStateOverride::CancelRequest() { 91 void PowerStateOverride::CancelRequest() {
93 if (request_id_) { 92 if (request_id_) {
94 DCHECK(dbus_thread_manager_); 93 DCHECK(dbus_thread_manager_);
95 dbus_thread_manager_->GetPowerManagerClient()-> 94 dbus_thread_manager_->GetPowerManagerClient()->
96 CancelPowerStateOverrides(request_id_); 95 CancelPowerStateOverrides(request_id_);
97 request_id_ = 0; 96 request_id_ = 0;
98 } 97 }
99 } 98 }
100 99
101 } // namespace chromeos 100 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/power/power_state_override.h ('k') | chromeos/power/power_state_override_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698