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

Side by Side Diff: chromeos/dbus/fake_power_manager_client.cc

Issue 240343004: chromeos: Update IdleActionImminent and SuspendDone handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 8 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/dbus/fake_power_manager_client.h" 5 #include "chromeos/dbus/fake_power_manager_client.h"
6 #include "chromeos/dbus/power_manager/policy.pb.h" 6 #include "chromeos/dbus/power_manager/policy.pb.h"
7 7
8 namespace chromeos { 8 namespace chromeos {
9 9
10 FakePowerManagerClient::FakePowerManagerClient() 10 FakePowerManagerClient::FakePowerManagerClient()
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 void FakePowerManagerClient::NotifyUserActivity( 87 void FakePowerManagerClient::NotifyUserActivity(
88 power_manager::UserActivityType type) { 88 power_manager::UserActivityType type) {
89 } 89 }
90 90
91 void FakePowerManagerClient::SendSuspendImminent() { 91 void FakePowerManagerClient::SendSuspendImminent() {
92 FOR_EACH_OBSERVER(Observer, observers_, SuspendImminent()); 92 FOR_EACH_OBSERVER(Observer, observers_, SuspendImminent());
93 } 93 }
94 94
95 void FakePowerManagerClient::SendSuspendStateChanged( 95 void FakePowerManagerClient::SendSuspendDone() {
96 const power_manager::SuspendState& suspend_state) { 96 FOR_EACH_OBSERVER(Observer, observers_, SuspendDone(base::TimeDelta()));
97 base::Time wall_time =
98 base::Time::FromInternalValue(suspend_state.wall_time());
99 switch (suspend_state.type()) {
100 case power_manager::SuspendState_Type_SUSPEND_TO_MEMORY:
101 last_suspend_wall_time_ = wall_time;
102 break;
103 case power_manager::SuspendState_Type_RESUME:
104 FOR_EACH_OBSERVER(Observer, observers_,
105 SystemResumed(wall_time - last_suspend_wall_time_));
106 break;
107 }
108 } 97 }
109 98
110 } // namespace chromeos 99 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698