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

Unified Diff: ash/common/system/audio/tray_audio.cc

Issue 2190773002: Fix Volume slider is captured in screenshot done in touchview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable hiding animation; restoring volume does not notify UI Created 4 years, 5 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/common/system/audio/tray_audio.cc
diff --git a/ash/common/system/audio/tray_audio.cc b/ash/common/system/audio/tray_audio.cc
index 8ff0987aadc01be209d8ef02a09d83a1fd738b8a..af2a9d58ec7e9e1246691b2db6217e76ca2c62af 100644
--- a/ash/common/system/audio/tray_audio.cc
+++ b/ash/common/system/audio/tray_audio.cc
@@ -38,6 +38,8 @@
#include "ui/views/layout/box_layout.h"
#include "ui/views/view.h"
+#include "ui/views/widget/widget.h"
+
namespace ash {
TrayAudio::TrayAudio(SystemTray* system_tray,
@@ -46,13 +48,17 @@ TrayAudio::TrayAudio(SystemTray* system_tray,
audio_delegate_(std::move(audio_delegate)),
volume_view_(NULL),
pop_up_volume_view_(false) {
- WmShell::Get()->system_tray_notifier()->AddAudioObserver(this);
+ SystemTrayNotifier* notifier = WmShell::Get()->system_tray_notifier();
+ notifier->AddAudioObserver(this);
+ notifier->AddMaximizeModeScreenshotObserver(this);
display::Screen::GetScreen()->AddObserver(this);
}
TrayAudio::~TrayAudio() {
display::Screen::GetScreen()->RemoveObserver(this);
- WmShell::Get()->system_tray_notifier()->RemoveAudioObserver(this);
+ SystemTrayNotifier* notifier = WmShell::Get()->system_tray_notifier();
+ notifier->RemoveMaximizeModeScreenshotObserver(this);
+ notifier->RemoveAudioObserver(this);
}
// static
@@ -138,6 +144,10 @@ void TrayAudio::OnActiveInputNodeChanged() {
Update();
}
+void TrayAudio::OnWillTakeScreenshotInMaximizeMode() {
+ HideDetailedView(false);
+}
+
void TrayAudio::ChangeInternalSpeakerChannelMode() {
// Swap left/right channel only if it is in Yoga mode.
system::TrayAudioDelegate::AudioChannelMode channel_mode =

Powered by Google App Engine
This is Rietveld 408576698