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

Side by Side Diff: ash/common/system/chromeos/audio/tray_audio.cc

Issue 2491033006: Adjust positioning of cros tray bubbles. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "ash/common/system/chromeos/audio/tray_audio.h" 5 #include "ash/common/system/chromeos/audio/tray_audio.h"
6 6
7 #include "ash/common/system/chromeos/audio/audio_detailed_view.h" 7 #include "ash/common/system/chromeos/audio/audio_detailed_view.h"
8 #include "ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.h" 8 #include "ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.h"
9 #include "ash/common/system/chromeos/audio/volume_view.h" 9 #include "ash/common/system/chromeos/audio/volume_view.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 void TrayAudio::DestroyDetailedView() { 86 void TrayAudio::DestroyDetailedView() {
87 if (audio_detail_view_) { 87 if (audio_detail_view_) {
88 audio_detail_view_ = nullptr; 88 audio_detail_view_ = nullptr;
89 } else if (volume_view_) { 89 } else if (volume_view_) {
90 volume_view_ = nullptr; 90 volume_view_ = nullptr;
91 pop_up_volume_view_ = false; 91 pop_up_volume_view_ = false;
92 } 92 }
93 } 93 }
94 94
95 bool TrayAudio::ShouldHideArrow() const {
96 return true;
97 }
98
99 bool TrayAudio::ShouldShowShelf() const { 95 bool TrayAudio::ShouldShowShelf() const {
100 return !pop_up_volume_view_; 96 return !pop_up_volume_view_;
101 } 97 }
102 98
103 void TrayAudio::OnOutputNodeVolumeChanged(uint64_t /* node_id */, 99 void TrayAudio::OnOutputNodeVolumeChanged(uint64_t /* node_id */,
104 int /* volume */) { 100 int /* volume */) {
105 float percent = 101 float percent =
106 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f; 102 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f;
107 if (tray_view()) 103 if (tray_view())
108 tray_view()->SetVisible(GetInitialVisibility()); 104 tray_view()->SetVisible(GetInitialVisibility());
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 volume_view_->SetVolumeLevel( 201 volume_view_->SetVolumeLevel(
206 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f); 202 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f);
207 volume_view_->Update(); 203 volume_view_->Update();
208 } 204 }
209 205
210 if (audio_detail_view_) 206 if (audio_detail_view_)
211 audio_detail_view_->Update(); 207 audio_detail_view_->Update();
212 } 208 }
213 209
214 } // namespace ash 210 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/audio/tray_audio.h ('k') | ash/common/system/chromeos/brightness/tray_brightness.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698