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

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

Issue 385073009: Side Slide Gestures for Accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Memory leak Created 6 years, 4 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
« no previous file with comments | « ash/root_window_controller.cc ('k') | chromeos/audio/cras_audio_handler.h » ('j') | 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 "ash/audio/sounds.h" 8 #include "ash/audio/sounds.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 bool VolumeController::HandleVolumeDown(const ui::Accelerator& accelerator) { 61 bool VolumeController::HandleVolumeDown(const ui::Accelerator& accelerator) {
62 if (accelerator.key_code() == ui::VKEY_VOLUME_DOWN) 62 if (accelerator.key_code() == ui::VKEY_VOLUME_DOWN)
63 content::RecordAction(base::UserMetricsAction("Accel_VolumeDown_F9")); 63 content::RecordAction(base::UserMetricsAction("Accel_VolumeDown_F9"));
64 64
65 CrasAudioHandler* audio_handler = CrasAudioHandler::Get(); 65 CrasAudioHandler* audio_handler = CrasAudioHandler::Get();
66 if (audio_handler->IsOutputMuted()) { 66 if (audio_handler->IsOutputMuted()) {
67 audio_handler->SetOutputVolumePercent(0); 67 audio_handler->SetOutputVolumePercent(0);
68 } else { 68 } else {
69 audio_handler->AdjustOutputVolumeByPercent(-kStepPercentage); 69 audio_handler->AdjustOutputVolumeByPercent(-kStepPercentage);
70 if (audio_handler->IsOutputVolumeBelowDefaultMuteLvel()) 70 if (audio_handler->IsOutputVolumeBelowDefaultMuteLevel())
71 audio_handler->SetOutputMute(true); 71 audio_handler->SetOutputMute(true);
72 else 72 else
73 PlayVolumeAdjustSound(); 73 PlayVolumeAdjustSound();
74 } 74 }
75 return true; 75 return true;
76 } 76 }
77 77
78 bool VolumeController::HandleVolumeUp(const ui::Accelerator& accelerator) { 78 bool VolumeController::HandleVolumeUp(const ui::Accelerator& accelerator) {
79 if (accelerator.key_code() == ui::VKEY_VOLUME_UP) 79 if (accelerator.key_code() == ui::VKEY_VOLUME_UP)
80 content::RecordAction(base::UserMetricsAction("Accel_VolumeUp_F10")); 80 content::RecordAction(base::UserMetricsAction("Accel_VolumeUp_F10"));
(...skipping 20 matching lines...) Expand all
101 audio_handler->GetOutputVolumePercent(), 101 audio_handler->GetOutputVolumePercent(),
102 audio_handler->IsOutputMuted()); 102 audio_handler->IsOutputMuted());
103 } 103 }
104 104
105 void VolumeController::OnOutputMuteChanged() { 105 void VolumeController::OnOutputMuteChanged() {
106 CrasAudioHandler* audio_handler = CrasAudioHandler::Get(); 106 CrasAudioHandler* audio_handler = CrasAudioHandler::Get();
107 extensions::DispatchVolumeChangedEvent( 107 extensions::DispatchVolumeChangedEvent(
108 audio_handler->GetOutputVolumePercent(), 108 audio_handler->GetOutputVolumePercent(),
109 audio_handler->IsOutputMuted()); 109 audio_handler->IsOutputMuted());
110 } 110 }
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | chromeos/audio/cras_audio_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698