OLD | NEW |
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/dbus/power_manager_client.h" | 5 #include "chromeos/dbus/power_manager_client.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 &PowerManagerClientStubImpl::Update); | 775 &PowerManagerClientStubImpl::Update); |
776 } else { | 776 } else { |
777 timer_.Stop(); | 777 timer_.Stop(); |
778 } | 778 } |
779 } | 779 } |
780 | 780 |
781 virtual void RequestRestart() OVERRIDE {} | 781 virtual void RequestRestart() OVERRIDE {} |
782 virtual void RequestShutdown() OVERRIDE {} | 782 virtual void RequestShutdown() OVERRIDE {} |
783 | 783 |
784 virtual void RequestIdleNotification(int64 threshold) OVERRIDE { | 784 virtual void RequestIdleNotification(int64 threshold) OVERRIDE { |
785 MessageLoop::current()->PostDelayedTask( | 785 base::MessageLoop::current()->PostDelayedTask( |
786 FROM_HERE, | 786 FROM_HERE, |
787 base::Bind(&PowerManagerClientStubImpl::TriggerIdleNotify, | 787 base::Bind(&PowerManagerClientStubImpl::TriggerIdleNotify, |
788 base::Unretained(this), | 788 base::Unretained(this), |
789 threshold), | 789 threshold), |
790 base::TimeDelta::FromMilliseconds(threshold)); | 790 base::TimeDelta::FromMilliseconds(threshold)); |
791 } | 791 } |
792 | 792 |
793 virtual void NotifyUserActivity() OVERRIDE {} | 793 virtual void NotifyUserActivity() OVERRIDE {} |
794 virtual void NotifyVideoActivity( | 794 virtual void NotifyVideoActivity( |
795 const base::TimeTicks& last_activity_time, | 795 const base::TimeTicks& last_activity_time, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 PowerManagerClient* PowerManagerClient::Create( | 875 PowerManagerClient* PowerManagerClient::Create( |
876 DBusClientImplementationType type, | 876 DBusClientImplementationType type, |
877 dbus::Bus* bus) { | 877 dbus::Bus* bus) { |
878 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 878 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
879 return new PowerManagerClientImpl(bus); | 879 return new PowerManagerClientImpl(bus); |
880 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 880 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
881 return new PowerManagerClientStubImpl(); | 881 return new PowerManagerClientStubImpl(); |
882 } | 882 } |
883 | 883 |
884 } // namespace chromeos | 884 } // namespace chromeos |
OLD | NEW |