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 "chrome/browser/chromeos/audio/audio_handler.h" | 5 #include "chrome/browser/chromeos/audio/audio_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
| 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" |
10 #include "base/logging.h" | 12 #include "base/logging.h" |
11 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
12 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
13 #if defined(USE_CRAS) | 15 #if defined(USE_CRAS) |
14 #include "chrome/browser/chromeos/audio/audio_mixer_cras.h" | 16 #include "chrome/browser/chromeos/audio/audio_mixer_cras.h" |
15 #else | 17 #else |
16 #include "chrome/browser/chromeos/audio/audio_mixer_alsa.h" | 18 #include "chrome/browser/chromeos/audio/audio_mixer_alsa.h" |
17 #endif | 19 #endif |
18 #include "chrome/browser/prefs/pref_service.h" | 20 #include "chrome/browser/prefs/pref_service.h" |
19 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
20 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
21 #include "content/public/browser/browser_thread.h" | |
22 | 23 |
23 using std::max; | 24 using std::max; |
24 using std::min; | 25 using std::min; |
25 | 26 |
26 namespace chromeos { | 27 namespace chromeos { |
27 | 28 |
28 namespace { | 29 namespace { |
29 | 30 |
30 // Default value for the volume pref, as a percent in the range [0.0, 100.0]. | 31 // Default value for the volume pref, as a percent in the range [0.0, 100.0]. |
31 const double kDefaultVolumePercent = 75.0; | 32 const double kDefaultVolumePercent = 75.0; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 mixer_->SetCaptureMuteLocked(false); | 200 mixer_->SetCaptureMuteLocked(false); |
200 if (local_state_->GetBoolean(prefs::kAudioCaptureAllowed)) { | 201 if (local_state_->GetBoolean(prefs::kAudioCaptureAllowed)) { |
201 mixer_->SetCaptureMuted(false); | 202 mixer_->SetCaptureMuted(false); |
202 } else { | 203 } else { |
203 mixer_->SetCaptureMuted(true); | 204 mixer_->SetCaptureMuted(true); |
204 mixer_->SetCaptureMuteLocked(true); | 205 mixer_->SetCaptureMuteLocked(true); |
205 } | 206 } |
206 } | 207 } |
207 | 208 |
208 } // namespace chromeos | 209 } // namespace chromeos |
OLD | NEW |