OLD | NEW |
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 "chrome/browser/chromeos/audio/audio_devices_pref_handler_impl.h" | 5 #include "chrome/browser/chromeos/audio/audio_devices_pref_handler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/prefs/pref_registry_simple.h" | 12 #include "base/prefs/pref_registry_simple.h" |
13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 15 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
16 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
18 #include "chromeos/audio/audio_device.h" | 18 #include "chromeos/audio/audio_device.h" |
19 #include "chromeos/audio/cras_audio_handler.h" | 19 #include "chromeos/audio/cras_audio_handler.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 std::string GetDeviceIdString(const chromeos::AudioDevice& device) { | 23 std::string GetDeviceIdString(const chromeos::AudioDevice& device) { |
24 return device.display_name + " : " + | 24 return device.display_name + " : " + |
25 base::Uint64ToString((device.id & ((1ULL << 32) - 1))); | 25 base::Uint64ToString(device.id & static_cast<uint64>(0xffffffff)); |
26 } | 26 } |
27 | 27 |
28 } | 28 } |
29 | 29 |
30 namespace chromeos { | 30 namespace chromeos { |
31 | 31 |
32 double AudioDevicesPrefHandlerImpl::GetVolumeGainValue( | 32 double AudioDevicesPrefHandlerImpl::GetVolumeGainValue( |
33 const AudioDevice& device) { | 33 const AudioDevice& device) { |
34 UpdateDevicesVolumePref(); | 34 UpdateDevicesVolumePref(); |
35 | 35 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // handler code. | 180 // handler code. |
181 } | 181 } |
182 | 182 |
183 // static | 183 // static |
184 AudioDevicesPrefHandler* AudioDevicesPrefHandler::Create( | 184 AudioDevicesPrefHandler* AudioDevicesPrefHandler::Create( |
185 PrefService* local_state) { | 185 PrefService* local_state) { |
186 return new AudioDevicesPrefHandlerImpl(local_state); | 186 return new AudioDevicesPrefHandlerImpl(local_state); |
187 } | 187 } |
188 | 188 |
189 } // namespace chromeos | 189 } // namespace chromeos |
OLD | NEW |