| 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 "chromeos/audio/cras_audio_handler.h" | 5 #include "chromeos/audio/cras_audio_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 g_cras_audio_handler = NULL; | 114 g_cras_audio_handler = NULL; |
| 115 } | 115 } |
| 116 | 116 |
| 117 // static | 117 // static |
| 118 bool CrasAudioHandler::IsInitialized() { | 118 bool CrasAudioHandler::IsInitialized() { |
| 119 return g_cras_audio_handler != NULL; | 119 return g_cras_audio_handler != NULL; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // static | 122 // static |
| 123 CrasAudioHandler* CrasAudioHandler::Get() { | 123 CrasAudioHandler* CrasAudioHandler::Get() { |
| 124 CHECK(g_cras_audio_handler) | 124 // CrasAudioHandler::Get() called before Initialize(). |
| 125 << "CrasAudioHandler::Get() called before Initialize()."; | 125 CHECK(g_cras_audio_handler); |
| 126 return g_cras_audio_handler; | 126 return g_cras_audio_handler; |
| 127 } | 127 } |
| 128 | 128 |
| 129 void CrasAudioHandler::AddAudioObserver(AudioObserver* observer) { | 129 void CrasAudioHandler::AddAudioObserver(AudioObserver* observer) { |
| 130 observers_.AddObserver(observer); | 130 observers_.AddObserver(observer); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void CrasAudioHandler::RemoveAudioObserver(AudioObserver* observer) { | 133 void CrasAudioHandler::RemoveAudioObserver(AudioObserver* observer) { |
| 134 observers_.RemoveObserver(observer); | 134 observers_.RemoveObserver(observer); |
| 135 } | 135 } |
| (...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 hdmi_rediscover_grace_period_duration_in_ms_), | 1386 hdmi_rediscover_grace_period_duration_in_ms_), |
| 1387 this, &CrasAudioHandler::UpdateAudioAfterHDMIRediscoverGracePeriod); | 1387 this, &CrasAudioHandler::UpdateAudioAfterHDMIRediscoverGracePeriod); |
| 1388 } | 1388 } |
| 1389 | 1389 |
| 1390 void CrasAudioHandler::SetHDMIRediscoverGracePeriodForTesting( | 1390 void CrasAudioHandler::SetHDMIRediscoverGracePeriodForTesting( |
| 1391 int duration_in_ms) { | 1391 int duration_in_ms) { |
| 1392 hdmi_rediscover_grace_period_duration_in_ms_ = duration_in_ms; | 1392 hdmi_rediscover_grace_period_duration_in_ms_ = duration_in_ms; |
| 1393 } | 1393 } |
| 1394 | 1394 |
| 1395 } // namespace chromeos | 1395 } // namespace chromeos |
| OLD | NEW |