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

Side by Side Diff: ash/system/chromeos/audio/tray_audio_chromeos.cc

Issue 165393013: Resubmit 'Refactor the TrayAudio code so that it can be used by other platforms.' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/system/chromeos/audio/tray_audio_chromeos.h"
6
7 #include "ash/ash_switches.h"
8 #include "ash/metrics/user_metrics_recorder.h"
9 #include "ash/shell.h"
10 #include "ash/system/audio/volume_view.h"
11 #include "ash/system/chromeos/audio/audio_detailed_view.h"
12 #include "ash/system/chromeos/audio/tray_audio_delegate_chromeos.h"
13 #include "ui/views/view.h"
14
15 namespace ash {
16
17 using system::TrayAudioDelegate;
18 using system::TrayAudioDelegateChromeOs;
19
20 namespace internal {
21
22 TrayAudioChromeOs::TrayAudioChromeOs(SystemTray* system_tray)
23 : TrayAudio(system_tray,
24 scoped_ptr<TrayAudioDelegate>(new TrayAudioDelegateChromeOs())),
25 audio_detail_view_(NULL) {
26 }
27
28 TrayAudioChromeOs::~TrayAudioChromeOs() {
29 }
30
31 void TrayAudioChromeOs::Update() {
32 TrayAudio::Update();
33
34 if (audio_detail_view_)
35 audio_detail_view_->Update();
36 }
37
38 views::View* TrayAudioChromeOs::CreateDetailedView(user::LoginStatus status) {
39 if (!ash::switches::ShowAudioDeviceMenu() || pop_up_volume_view_) {
40 volume_view_ = new tray::VolumeView(this, audio_delegate_.get(), false);
41 return volume_view_;
42 } else {
43 Shell::GetInstance()->metrics()->RecordUserMetricsAction(
44 ash::UMA_STATUS_AREA_DETAILED_AUDIO_VIEW);
45 audio_detail_view_ =
46 new tray::AudioDetailedView(this, status);
47 return audio_detail_view_;
48 }
49 }
50
51 void TrayAudioChromeOs::DestroyDetailedView() {
52 if (audio_detail_view_) {
53 audio_detail_view_ = NULL;
54 } else if (volume_view_) {
55 volume_view_ = NULL;
56 pop_up_volume_view_ = false;
57 }
58 }
59
60 } // namespace internal
61 } // namespace ash
OLDNEW
« 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