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

Unified Diff: ash/system/chromeos/audio/tray_audio_chromeos.cc

Issue 2113113002: mash: Move chromeos audio system tray files to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: ash/system/chromeos/audio/tray_audio_chromeos.cc
diff --git a/ash/system/chromeos/audio/tray_audio_chromeos.cc b/ash/system/chromeos/audio/tray_audio_chromeos.cc
deleted file mode 100644
index 0fd8dd56a9c631e3a88fbfe8f0fcdeace2577891..0000000000000000000000000000000000000000
--- a/ash/system/chromeos/audio/tray_audio_chromeos.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright 2014 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 "ash/system/chromeos/audio/tray_audio_chromeos.h"
-
-#include "ash/common/system/audio/volume_view.h"
-#include "ash/common/wm_shell.h"
-#include "ash/system/chromeos/audio/audio_detailed_view.h"
-#include "ash/system/chromeos/audio/tray_audio_delegate_chromeos.h"
-#include "chromeos/dbus/dbus_thread_manager.h"
-#include "ui/views/view.h"
-
-namespace ash {
-
-using system::TrayAudioDelegate;
-using system::TrayAudioDelegateChromeOs;
-
-TrayAudioChromeOs::TrayAudioChromeOs(SystemTray* system_tray)
- : TrayAudio(
- system_tray,
- std::unique_ptr<TrayAudioDelegate>(new TrayAudioDelegateChromeOs())),
- audio_detail_view_(NULL) {
- chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(
- this);
-}
-
-TrayAudioChromeOs::~TrayAudioChromeOs() {
- chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(
- this);
-}
-
-void TrayAudioChromeOs::Update() {
- TrayAudio::Update();
-
- if (audio_detail_view_)
- audio_detail_view_->Update();
-}
-
-views::View* TrayAudioChromeOs::CreateDetailedView(LoginStatus status) {
- if (pop_up_volume_view_) {
- volume_view_ = new tray::VolumeView(this, audio_delegate_.get(), false);
- return volume_view_;
- } else {
- WmShell::Get()->RecordUserMetricsAction(
- UMA_STATUS_AREA_DETAILED_AUDIO_VIEW);
- audio_detail_view_ = new tray::AudioDetailedView(this);
- return audio_detail_view_;
- }
-}
-
-void TrayAudioChromeOs::DestroyDetailedView() {
- if (audio_detail_view_) {
- audio_detail_view_ = NULL;
- } else if (volume_view_) {
- volume_view_ = NULL;
- pop_up_volume_view_ = false;
- }
-}
-
-void TrayAudioChromeOs::OnDisplayAdded(const display::Display& new_display) {
- TrayAudio::OnDisplayAdded(new_display);
-
- // This event will be triggered when the lid of the device is opened to exit
- // the docked mode, we should always start or re-start HDMI re-discovering
- // grace period right after this event.
- audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true);
-}
-
-void TrayAudioChromeOs::OnDisplayRemoved(const display::Display& old_display) {
- TrayAudio::OnDisplayRemoved(old_display);
-
- // This event will be triggered when the lid of the device is closed to enter
- // the docked mode, we should always start or re-start HDMI re-discovering
- // grace period right after this event.
- audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true);
-}
-
-void TrayAudioChromeOs::OnDisplayMetricsChanged(const display::Display& display,
- uint32_t changed_metrics) {
- // The event could be triggered multiple times during the HDMI display
- // transition, we don't need to restart HDMI re-discovering grace period
- // it is already started earlier.
- audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(false);
-}
-
-void TrayAudioChromeOs::SuspendDone(const base::TimeDelta& sleep_duration) {
- // This event is triggered when the device resumes after earlier suspension,
- // we should always start or re-start HDMI re-discovering
- // grace period right after this event.
- audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true);
-}
-
-} // namespace ash
« no previous file with comments | « ash/system/chromeos/audio/tray_audio_chromeos.h ('k') | ash/system/chromeos/audio/tray_audio_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698