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

Side by Side Diff: chrome/browser/ui/ash/volume_controller_chromeos.cc

Issue 19693018: Do not increase volume when user press Volume Up Button to unmute the audio output. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ui/ash/volume_controller_chromeos.h" 5 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/chromeos/audio/audio_handler.h" 9 #include "chrome/browser/chromeos/audio/audio_handler.h"
10 #include "chrome/browser/extensions/api/system_private/system_private_api.h" 10 #include "chrome/browser/extensions/api/system_private/system_private_api.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 bool VolumeController::HandleVolumeUp(const ui::Accelerator& accelerator) { 80 bool VolumeController::HandleVolumeUp(const ui::Accelerator& accelerator) {
81 if (accelerator.key_code() == ui::VKEY_VOLUME_UP) 81 if (accelerator.key_code() == ui::VKEY_VOLUME_UP)
82 content::RecordAction(content::UserMetricsAction("Accel_VolumeUp_F10")); 82 content::RecordAction(content::UserMetricsAction("Accel_VolumeUp_F10"));
83 83
84 if (ash::switches::UseNewAudioHandler()) { 84 if (ash::switches::UseNewAudioHandler()) {
85 CrasAudioHandler* audio_handler = CrasAudioHandler::Get(); 85 CrasAudioHandler* audio_handler = CrasAudioHandler::Get();
86 86
87 if (audio_handler->IsOutputMuted()) 87 if (audio_handler->IsOutputMuted())
88 audio_handler->SetOutputMute(false); 88 audio_handler->SetOutputMute(false);
89 audio_handler->AdjustOutputVolumeByPercent(kStepPercentage); 89 else
90 audio_handler->AdjustOutputVolumeByPercent(kStepPercentage);
90 return true; 91 return true;
91 } 92 }
92 93
93 chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance(); 94 chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance();
94 if (audio_handler->IsMuted()) { 95 if (audio_handler->IsMuted()) {
95 audio_handler->SetMuted(false); 96 audio_handler->SetMuted(false);
96 } else { 97 } else {
97 audio_handler->AdjustVolumeByPercent(kStepPercentage); 98 audio_handler->AdjustVolumeByPercent(kStepPercentage);
98 } 99 }
99 100
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 audio_handler->IsOutputMuted()); 140 audio_handler->IsOutputMuted());
140 } 141 }
141 142
142 void VolumeController::OnOutputMuteChanged() { 143 void VolumeController::OnOutputMuteChanged() {
143 DCHECK(ash::switches::UseNewAudioHandler()); 144 DCHECK(ash::switches::UseNewAudioHandler());
144 CrasAudioHandler* audio_handler = CrasAudioHandler::Get(); 145 CrasAudioHandler* audio_handler = CrasAudioHandler::Get();
145 extensions::DispatchVolumeChangedEvent( 146 extensions::DispatchVolumeChangedEvent(
146 audio_handler->GetOutputVolumePercent(), 147 audio_handler->GetOutputVolumePercent(),
147 audio_handler->IsOutputMuted()); 148 audio_handler->IsOutputMuted());
148 } 149 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698