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

Unified Diff: chrome/browser/ui/views/ash/volume_controller_chromeos.cc

Issue 10421010: Revert 138278 - Fix the volume controlling behaviors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/ash/volume_controller_chromeos.cc
===================================================================
--- chrome/browser/ui/views/ash/volume_controller_chromeos.cc (revision 138298)
+++ chrome/browser/ui/views/ash/volume_controller_chromeos.cc (working copy)
@@ -14,6 +14,11 @@
// Percent by which the volume should be changed when a volume key is pressed.
const double kStepPercentage = 4.0;
+// Percent to which the volume should be set when the "volume up" key is pressed
+// while we're muted and have the volume set to 0. See
+// http://crosbug.com/13618.
+const double kVolumePercentOnVolumeUpWhileMuted = 25.0;
+
} // namespace
bool VolumeController::HandleVolumeMute(const ui::Accelerator& accelerator) {
@@ -53,11 +58,8 @@
chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance();
if (audio_handler->IsMuted()) {
audio_handler->SetMuted(false);
- // If volume percent is still 0.0 after reset the mute status, it means that
- // the mute status was done by VolumeDown, so we need to increase
- // the volume as usual.
- if (audio_handler->GetVolumePercent() == 0.0)
- audio_handler->AdjustVolumeByPercent(kStepPercentage);
+ if (audio_handler->GetVolumePercent() <= 0.1) // float comparison
+ audio_handler->SetVolumePercent(kVolumePercentOnVolumeUpWhileMuted);
} else {
audio_handler->AdjustVolumeByPercent(kStepPercentage);
}
« no previous file with comments | « chrome/browser/chromeos/audio/audio_handler.cc ('k') | chrome/browser/ui/views/ash/volume_controller_chromeos_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698