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

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

Issue 9570044: Rename chrome/browser/ui/views/{aura => ash}/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 10 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/aura/volume_controller_chromeos.cc
diff --git a/chrome/browser/ui/views/aura/volume_controller_chromeos.cc b/chrome/browser/ui/views/aura/volume_controller_chromeos.cc
deleted file mode 100644
index 3621557babc93b4b5ecd988701bd2b1b6c50902f..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/views/aura/volume_controller_chromeos.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/views/aura/volume_controller_chromeos.h"
-
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chromeos/audio/audio_handler.h"
-#include "chrome/browser/chromeos/ui/brightness_bubble.h"
-#include "chrome/browser/chromeos/ui/volume_bubble.h"
-#include "chrome/browser/extensions/system/system_api.h"
-#include "content/public/browser/user_metrics.h"
-
-namespace {
-
-// 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;
-
-void ShowVolumeBubble() {
- chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance();
- chromeos::VolumeBubble::GetInstance()->ShowBubble(
- audio_handler->GetVolumePercent(),
- !audio_handler->IsMuted());
- chromeos::BrightnessBubble::GetInstance()->HideBubble();
-}
-
-} // namespace
-
-bool VolumeController::HandleVolumeMute(const ui::Accelerator& accelerator) {
- if (accelerator.key_code() == ui::VKEY_F8)
- content::RecordAction(content::UserMetricsAction("Accel_VolumeMute_F8"));
-
- chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance();
-
- // Always muting (and not toggling) as per final decision on
- // http://crosbug.com/3751
- audio_handler->SetMuted(true);
-
- extensions::DispatchVolumeChangedEvent(audio_handler->GetVolumePercent(),
- audio_handler->IsMuted());
- ShowVolumeBubble();
- return true;
-}
-
-bool VolumeController::HandleVolumeDown(const ui::Accelerator& accelerator) {
- if (accelerator.key_code() == ui::VKEY_F9)
- content::RecordAction(content::UserMetricsAction("Accel_VolumeDown_F9"));
-
- chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance();
- if (audio_handler->IsMuted())
- audio_handler->SetVolumePercent(0.0);
- else
- audio_handler->AdjustVolumeByPercent(-kStepPercentage);
-
- extensions::DispatchVolumeChangedEvent(audio_handler->GetVolumePercent(),
- audio_handler->IsMuted());
- ShowVolumeBubble();
- return true;
-}
-
-bool VolumeController::HandleVolumeUp(const ui::Accelerator& accelerator) {
- if (accelerator.key_code() == ui::VKEY_F10)
- content::RecordAction(content::UserMetricsAction("Accel_VolumeUp_F10"));
-
- chromeos::AudioHandler* audio_handler = chromeos::AudioHandler::GetInstance();
- if (audio_handler->IsMuted()) {
- audio_handler->SetMuted(false);
- if (audio_handler->GetVolumePercent() <= 0.1) // float comparison
- audio_handler->SetVolumePercent(kVolumePercentOnVolumeUpWhileMuted);
- } else {
- audio_handler->AdjustVolumeByPercent(kStepPercentage);
- }
-
- extensions::DispatchVolumeChangedEvent(audio_handler->GetVolumePercent(),
- audio_handler->IsMuted());
- ShowVolumeBubble();
- return true;
-}
« no previous file with comments | « chrome/browser/ui/views/aura/volume_controller_chromeos.h ('k') | chrome/browser/ui/views/frame/browser_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698