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

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

Issue 1380103003: Store audio device's active state in preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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/audio_node.h" 5 #include "chromeos/dbus/audio_node.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 10
11 namespace chromeos { 11 namespace chromeos {
12 12
13 AudioNode::AudioNode() 13 AudioNode::AudioNode()
14 : is_input(false), 14 : is_input(false),
15 id(0), 15 id(0),
16 active(false), 16 active(false),
17 plugged_time(0) { 17 plugged_time(0) {
18 } 18 }
19 19
20 AudioNode::AudioNode(bool is_input, 20 AudioNode::AudioNode(bool is_input,
21 uint64 id, 21 uint64 id,
22 uint64 stable_device_id,
22 std::string device_name, 23 std::string device_name,
23 std::string type, 24 std::string type,
24 std::string name, 25 std::string name,
25 bool active, 26 bool active,
26 uint64 plugged_time) 27 uint64 plugged_time)
27 : is_input(is_input), 28 : is_input(is_input),
28 id(id), 29 id(id),
30 stable_device_id(stable_device_id),
29 device_name(device_name), 31 device_name(device_name),
30 type(type), 32 type(type),
31 name(name), 33 name(name),
32 active(active), 34 active(active),
33 plugged_time(plugged_time) { 35 plugged_time(plugged_time) {
34 } 36 }
35 37
36 AudioNode::~AudioNode() {} 38 AudioNode::~AudioNode() {}
37 39
38 std::string AudioNode::ToString() const { 40 std::string AudioNode::ToString() const {
39 std::string result; 41 std::string result;
40 base::StringAppendF(&result, 42 base::StringAppendF(&result,
41 "is_input = %s ", 43 "is_input = %s ",
42 is_input ? "true" : "false"); 44 is_input ? "true" : "false");
43 base::StringAppendF(&result, 45 base::StringAppendF(&result,
44 "id = 0x%" PRIx64 " ", 46 "id = 0x%" PRIx64 " ",
45 id); 47 id);
46 base::StringAppendF(&result, 48 base::StringAppendF(&result,
49 "stable_device_id = 0x%" PRIx64 " ",
50 stable_device_id);
51 base::StringAppendF(&result,
47 "device_name = %s ", 52 "device_name = %s ",
48 device_name.c_str()); 53 device_name.c_str());
49 base::StringAppendF(&result, 54 base::StringAppendF(&result,
50 "type = %s ", 55 "type = %s ",
51 type.c_str()); 56 type.c_str());
52 base::StringAppendF(&result, 57 base::StringAppendF(&result,
53 "name = %s ", 58 "name = %s ",
54 name.c_str()); 59 name.c_str());
55 base::StringAppendF(&result, 60 base::StringAppendF(&result,
56 "active = %s ", 61 "active = %s ",
57 active ? "true" : "false"); 62 active ? "true" : "false");
58 base::StringAppendF(&result, 63 base::StringAppendF(&result,
59 "plugged_time= %s ", 64 "plugged_time= %s ",
60 base::Uint64ToString(plugged_time).c_str()); 65 base::Uint64ToString(plugged_time).c_str());
61 66
62 return result; 67 return result;
63 } 68 }
64 69
65 } // namespace chromeos 70 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698