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

Side by Side Diff: ash/common/system/audio/tray_audio.h

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: remove OnDidTakeScreenshot; clean code Created 4 years, 4 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
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 #ifndef ASH_COMMON_SYSTEM_AUDIO_TRAY_AUDIO_H_ 5 #ifndef ASH_COMMON_SYSTEM_AUDIO_TRAY_AUDIO_H_
6 #define ASH_COMMON_SYSTEM_AUDIO_TRAY_AUDIO_H_ 6 #define ASH_COMMON_SYSTEM_AUDIO_TRAY_AUDIO_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "ash/common/system/audio/audio_observer.h" 12 #include "ash/common/system/audio/audio_observer.h"
13 #include "ash/common/system/tray/tray_image_item.h" 13 #include "ash/common/system/tray/tray_image_item.h"
14 #include "ash/common/wm/maximize_mode/maximize_mode_screenshot_observer.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "ui/display/display_observer.h" 16 #include "ui/display/display_observer.h"
16 17
17 namespace ash { 18 namespace ash {
18 19
19 namespace system { 20 namespace system {
20 class TrayAudioDelegate; 21 class TrayAudioDelegate;
21 } 22 }
22 23
23 namespace tray { 24 namespace tray {
24 class VolumeView; 25 class VolumeView;
25 } 26 }
26 27
27 class TrayAudio : public TrayImageItem, 28 class TrayAudio : public TrayImageItem,
28 public AudioObserver, 29 public AudioObserver,
29 public display::DisplayObserver { 30 public display::DisplayObserver,
31 public MaximizeModeScreenshotObserver {
30 public: 32 public:
31 TrayAudio(SystemTray* system_tray, 33 TrayAudio(SystemTray* system_tray,
32 std::unique_ptr<system::TrayAudioDelegate> audio_delegate); 34 std::unique_ptr<system::TrayAudioDelegate> audio_delegate);
33 ~TrayAudio() override; 35 ~TrayAudio() override;
34 36
35 static bool ShowAudioDeviceMenu(); 37 static bool ShowAudioDeviceMenu();
36 38
37 protected: 39 protected:
38 // Overridden from display::DisplayObserver. 40 // Overridden from display::DisplayObserver.
39 void OnDisplayAdded(const display::Display& new_display) override; 41 void OnDisplayAdded(const display::Display& new_display) override;
(...skipping 22 matching lines...) Expand all
62 bool ShouldHideArrow() const override; 64 bool ShouldHideArrow() const override;
63 bool ShouldShowShelf() const override; 65 bool ShouldShowShelf() const override;
64 66
65 // Overridden from AudioObserver. 67 // Overridden from AudioObserver.
66 void OnOutputNodeVolumeChanged(uint64_t node_id, double volume) override; 68 void OnOutputNodeVolumeChanged(uint64_t node_id, double volume) override;
67 void OnOutputMuteChanged(bool mute_on, bool system_adjust) override; 69 void OnOutputMuteChanged(bool mute_on, bool system_adjust) override;
68 void OnAudioNodesChanged() override; 70 void OnAudioNodesChanged() override;
69 void OnActiveOutputNodeChanged() override; 71 void OnActiveOutputNodeChanged() override;
70 void OnActiveInputNodeChanged() override; 72 void OnActiveInputNodeChanged() override;
71 73
74 // Overridden from MaximizeModeScreenshotObserver.
75 void OnWillTakeScreenshotInMaximizeMode() override;
76
72 void ChangeInternalSpeakerChannelMode(); 77 void ChangeInternalSpeakerChannelMode();
73 78
79 // Indicator if it is doing restoring volume after a maximize mode screenshot.
80 // If true, this volume set should not has popup view.
81 bool hide_popup_;
82
74 DISALLOW_COPY_AND_ASSIGN(TrayAudio); 83 DISALLOW_COPY_AND_ASSIGN(TrayAudio);
75 }; 84 };
76 85
77 } // namespace ash 86 } // namespace ash
78 87
79 #endif // ASH_COMMON_SYSTEM_AUDIO_TRAY_AUDIO_H_ 88 #endif // ASH_COMMON_SYSTEM_AUDIO_TRAY_AUDIO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698