summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorjennyz <jennyz@chromium.org>2015-07-28 16:04:35 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-28 23:05:22 +0000
commitc79ccda3ba8d2259370e7cc25dc62117750e6496 (patch)
treec73a4e229871f6df6a09f693211f3d8aa2908e18 /ash
parent0444616094fcba557a06eb292ebd568281f82c84 (diff)
downloadchromium_src-c79ccda3ba8d2259370e7cc25dc62117750e6496.zip
chromium_src-c79ccda3ba8d2259370e7cc25dc62117750e6496.tar.gz
chromium_src-c79ccda3ba8d2259370e7cc25dc62117750e6496.tar.bz2
Fix the UI issue for showing output muted in ash tray after the device wakes up with hdmi output removed.
BUG=512601 TBR=mnissler,derat, rkc Review URL: https://codereview.chromium.org/1262723002 Cr-Commit-Position: refs/heads/master@{#340794}
Diffstat (limited to 'ash')
-rw-r--r--ash/system/audio/audio_observer.h7
-rw-r--r--ash/system/audio/tray_audio.cc4
-rw-r--r--ash/system/audio/tray_audio.h2
-rw-r--r--ash/system/tray/system_tray_notifier.cc5
-rw-r--r--ash/system/tray/system_tray_notifier.h2
5 files changed, 13 insertions, 7 deletions
diff --git a/ash/system/audio/audio_observer.h b/ash/system/audio/audio_observer.h
index 3b94ebc8..7a18e17 100644
--- a/ash/system/audio/audio_observer.h
+++ b/ash/system/audio/audio_observer.h
@@ -19,7 +19,12 @@ class AudioObserver {
virtual void OnOutputNodeVolumeChanged(uint64_t node_id, double volume) = 0;
// Called when output mute state changed.
- virtual void OnOutputMuteChanged(bool mute_on) = 0;
+ // |mute_on|: True if output is muted.
+ // |system_adjust|: True if the mute state is adjusted by the system
+ // automatically, UI should be consistent with the system's mute state,
+ // but it should not be too loud, e.g., the volume pop up window should not
+ // be triggered.
+ virtual void OnOutputMuteChanged(bool mute_on, bool system_adjust) = 0;
// Called when audio nodes changed.
virtual void OnAudioNodesChanged() = 0;
diff --git a/ash/system/audio/tray_audio.cc b/ash/system/audio/tray_audio.cc
index 0109f29..41340bd 100644
--- a/ash/system/audio/tray_audio.cc
+++ b/ash/system/audio/tray_audio.cc
@@ -113,14 +113,14 @@ void TrayAudio::OnOutputNodeVolumeChanged(uint64_t /* node_id */,
PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false);
}
-void TrayAudio::OnOutputMuteChanged(bool /* mute_on */) {
+void TrayAudio::OnOutputMuteChanged(bool /* mute_on */, bool system_adjust) {
if (tray_view())
tray_view()->SetVisible(GetInitialVisibility());
if (volume_view_) {
volume_view_->Update();
SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds);
- } else {
+ } else if (!system_adjust) {
pop_up_volume_view_ = true;
PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false);
}
diff --git a/ash/system/audio/tray_audio.h b/ash/system/audio/tray_audio.h
index caf5760..9621eb8 100644
--- a/ash/system/audio/tray_audio.h
+++ b/ash/system/audio/tray_audio.h
@@ -60,7 +60,7 @@ class TrayAudio : public TrayImageItem,
// Overridden from AudioObserver.
void OnOutputNodeVolumeChanged(uint64_t node_id, double volume) override;
- void OnOutputMuteChanged(bool mute_on) override;
+ void OnOutputMuteChanged(bool mute_on, bool system_adjust) override;
void OnAudioNodesChanged() override;
void OnActiveOutputNodeChanged() override;
void OnActiveInputNodeChanged() override;
diff --git a/ash/system/tray/system_tray_notifier.cc b/ash/system/tray/system_tray_notifier.cc
index 40e7050..ec5bd8d 100644
--- a/ash/system/tray/system_tray_notifier.cc
+++ b/ash/system/tray/system_tray_notifier.cc
@@ -201,9 +201,10 @@ void SystemTrayNotifier::NotifyAudioOutputVolumeChanged(uint64_t node_id,
OnOutputNodeVolumeChanged(node_id, volume));
}
-void SystemTrayNotifier::NotifyAudioOutputMuteChanged(bool mute_on) {
+void SystemTrayNotifier::NotifyAudioOutputMuteChanged(bool mute_on,
+ bool system_adjust) {
FOR_EACH_OBSERVER(AudioObserver, audio_observers_,
- OnOutputMuteChanged(mute_on));
+ OnOutputMuteChanged(mute_on, system_adjust));
}
void SystemTrayNotifier::NotifyAudioNodesChanged() {
diff --git a/ash/system/tray/system_tray_notifier.h b/ash/system/tray/system_tray_notifier.h
index b46cb9a..e9a61fb 100644
--- a/ash/system/tray/system_tray_notifier.h
+++ b/ash/system/tray/system_tray_notifier.h
@@ -111,7 +111,7 @@ class ASH_EXPORT SystemTrayNotifier {
void NotifyAccessibilityModeChanged(
ui::AccessibilityNotificationVisibility notify);
void NotifyAudioOutputVolumeChanged(uint64_t node_id, double volume);
- void NotifyAudioOutputMuteChanged(bool mute_on);
+ void NotifyAudioOutputMuteChanged(bool mute_on, bool system_adjust);
void NotifyAudioNodesChanged();
void NotifyAudioActiveOutputNodeChanged();
void NotifyAudioActiveInputNodeChanged();