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

Unified Diff: chromeos/audio/cras_audio_handler.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: nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/power_button_controller.cc ('k') | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/cras_audio_handler.h
diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h
index c9110718e4a332a7bc0dde2b5a02d446857a8e2f..fbc8114ea3c0691960c34a4464996f24b62beebd 100644
--- a/chromeos/audio/cras_audio_handler.h
+++ b/chromeos/audio/cras_audio_handler.h
@@ -38,6 +38,15 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
AudioDeviceCompare> AudioDevicePriorityQueue;
typedef std::vector<uint64_t> NodeIdList;
+ // Volume change reasons that are not user-initiated.
+ enum AutomatedVolumeChangeReason {
+ // Indicates it is from initializing audio state.
+ VOLUME_CHANGE_INITIALIZING_AUDIO_STATE,
+
+ // Indicates it is from restoring volume in maximimize mode screenshot.
+ VOLUME_CHANGE_MAXIMIZE_MODE_SCREENSHOT,
+ };
+
class AudioObserver {
public:
// Called when an active output volume changed.
@@ -155,10 +164,16 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
virtual bool has_alternative_input() const;
virtual bool has_alternative_output() const;
- // Sets all active output devices' volume level to |volume_percent|, whose
+ // Sets all active output devices' volume levels to |volume_percent|, whose
// range is from 0-100%.
virtual void SetOutputVolumePercent(int volume_percent);
+ // Sets all active output devices' volume levels to |volume_percent|, whose
+ // range is from 0-100%, without notifying observers.
+ virtual void SetOutputVolumePercentWithoutNotifyingObservers(
+ int volume_percent,
+ AutomatedVolumeChangeReason reason);
+
// Sets all active input devices' gain level to |gain_percent|, whose range is
// from 0-100%.
virtual void SetInputGainPercent(int gain_percent);
@@ -432,10 +447,15 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
bool cras_service_available_ = false;
+ // FIFO list of reasons passed to
+ // SetOutputVolumePercentWithoutNotifyingObservers() for which we're still
+ // waiting for OutputNodeVolumeChanged() calls. These are used to suppress
+ // notifications for those changes.
+ std::deque<AutomatedVolumeChangeReason> automated_volume_change_reasons_;
+
bool initializing_audio_state_ = false;
int init_volume_;
uint64_t init_node_id_;
- int init_volume_count_ = 0;
base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_;
« no previous file with comments | « ash/wm/power_button_controller.cc ('k') | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698