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

Side by Side Diff: chrome/browser/chromeos/audio_handler.cc

Issue 5711001: Add a new GetInstance() method for remaining files with singleton classes under chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_handler.h" 5 #include "chrome/browser/chromeos/audio_handler.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/chromeos/pulse_audio_mixer.h" 10 #include "chrome/browser/chromeos/pulse_audio_mixer.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 return 100.0 * pow((volume_db - kMinVolumeDb) / 161 return 100.0 * pow((volume_db - kMinVolumeDb) /
162 (kMaxVolumeDb - kMinVolumeDb), 1/kVolumeBias); 162 (kMaxVolumeDb - kMinVolumeDb), 1/kVolumeBias);
163 } 163 }
164 164
165 // static 165 // static
166 double AudioHandler::PercentToVolumeDb(double volume_percent) { 166 double AudioHandler::PercentToVolumeDb(double volume_percent) {
167 return pow(volume_percent / 100.0, kVolumeBias) * 167 return pow(volume_percent / 100.0, kVolumeBias) *
168 (kMaxVolumeDb - kMinVolumeDb) + kMinVolumeDb; 168 (kMaxVolumeDb - kMinVolumeDb) + kMinVolumeDb;
169 } 169 }
170 170
171 // static
172 AudioHandler* AudioHandler::instance() {
173 return Singleton<AudioHandler>::get();
174 }
175
171 } // namespace chromeos 176 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698