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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/power_monitor/power_monitor_device_source.h" | 17 #include "base/power_monitor/power_monitor_device_source.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/string_split.h" | 19 #include "base/strings/string_split.h" |
20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
21 #include "base/threading/platform_thread.h" | 21 #include "base/threading/platform_thread.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "base/timer/timer.h" | 23 #include "base/timer/timer.h" |
24 #include "chromeos/chromeos_switches.h" | 24 #include "chromeos/chromeos_switches.h" |
25 #include "chromeos/dbus/power_manager/input_event.pb.h" | 25 #include "chromeos/dbus/power_manager/input_event.pb.h" |
26 #include "chromeos/dbus/power_manager/peripheral_battery_status.pb.h" | 26 #include "chromeos/dbus/power_manager/peripheral_battery_status.pb.h" |
27 #include "chromeos/dbus/power_manager/policy.pb.h" | 27 #include "chromeos/dbus/power_manager/policy.pb.h" |
28 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" | 28 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" |
29 #include "chromeos/dbus/power_manager/suspend.pb.h" | 29 #include "chromeos/dbus/power_manager/suspend.pb.h" |
30 #include "chromeos/device_event_log.h" | 30 #include "components/device_event_log/device_event_log.h" |
31 #include "dbus/bus.h" | 31 #include "dbus/bus.h" |
32 #include "dbus/message.h" | 32 #include "dbus/message.h" |
33 #include "dbus/object_path.h" | 33 #include "dbus/object_path.h" |
34 #include "dbus/object_proxy.h" | 34 #include "dbus/object_proxy.h" |
35 | 35 |
36 namespace chromeos { | 36 namespace chromeos { |
37 | 37 |
38 // Maximum amount of time that the power manager will wait for Chrome to | 38 // Maximum amount of time that the power manager will wait for Chrome to |
39 // say that it's ready for the system to be suspended, in milliseconds. | 39 // say that it's ready for the system to be suspended, in milliseconds. |
40 const int kSuspendDelayTimeoutMs = 5000; | 40 const int kSuspendDelayTimeoutMs = 5000; |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 // static | 1000 // static |
1001 PowerManagerClient* PowerManagerClient::Create( | 1001 PowerManagerClient* PowerManagerClient::Create( |
1002 DBusClientImplementationType type) { | 1002 DBusClientImplementationType type) { |
1003 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 1003 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
1004 return new PowerManagerClientImpl(); | 1004 return new PowerManagerClientImpl(); |
1005 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 1005 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
1006 return new PowerManagerClientStubImpl(); | 1006 return new PowerManagerClientStubImpl(); |
1007 } | 1007 } |
1008 | 1008 |
1009 } // namespace chromeos | 1009 } // namespace chromeos |
OLD | NEW |