Commit 73671d45 authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

cros: Rename startup_sound_played_ to oobe_startup_sound_played_

I spent some time porting this to LoginDisplayHost only to later
realize it only applies to oobe. Make that very clear/explicit it is
oobe-only.

Bug: 792654
Change-Id: I152b9399188cbd62451be2e6044620a30fc6f1e3
Reviewed-on: https://chromium-review.googlesource.com/824954Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527024}
parent 340026de
...@@ -416,7 +416,7 @@ class LoginDisplayHostWebUI::LoginWidgetDelegate ...@@ -416,7 +416,7 @@ class LoginDisplayHostWebUI::LoginWidgetDelegate
LoginDisplayHostWebUI::LoginDisplayHostWebUI(const gfx::Rect& wallpaper_bounds) LoginDisplayHostWebUI::LoginDisplayHostWebUI(const gfx::Rect& wallpaper_bounds)
: wallpaper_bounds_(wallpaper_bounds), : wallpaper_bounds_(wallpaper_bounds),
startup_sound_played_(StartupUtils::IsOobeCompleted()), oobe_startup_sound_played_(StartupUtils::IsOobeCompleted()),
animation_weak_ptr_factory_(this) { animation_weak_ptr_factory_(this) {
if (ash_util::IsRunningInMash()) { if (ash_util::IsRunningInMash()) {
// Animation, and initializing hidden, are not currently supported for Mash. // Animation, and initializing hidden, are not currently supported for Mash.
...@@ -628,7 +628,7 @@ void LoginDisplayHostWebUI::SetStatusAreaVisible(bool visible) { ...@@ -628,7 +628,7 @@ void LoginDisplayHostWebUI::SetStatusAreaVisible(bool visible) {
void LoginDisplayHostWebUI::StartWizard(OobeScreen first_screen) { void LoginDisplayHostWebUI::StartWizard(OobeScreen first_screen) {
DisableKeyboardOverscroll(); DisableKeyboardOverscroll();
TryToPlayStartupSound(); TryToPlayOobeStartupSound();
// Keep parameters to restore if renderer crashes. // Keep parameters to restore if renderer crashes.
restore_path_ = RESTORE_WIZARD; restore_path_ = RESTORE_WIZARD;
...@@ -928,7 +928,7 @@ void LoginDisplayHostWebUI::EmitLoginPromptVisibleCalled() { ...@@ -928,7 +928,7 @@ void LoginDisplayHostWebUI::EmitLoginPromptVisibleCalled() {
// LoginDisplayHostWebUI, chromeos::CrasAudioHandler::AudioObserver: // LoginDisplayHostWebUI, chromeos::CrasAudioHandler::AudioObserver:
void LoginDisplayHostWebUI::OnActiveOutputNodeChanged() { void LoginDisplayHostWebUI::OnActiveOutputNodeChanged() {
TryToPlayStartupSound(); TryToPlayOobeStartupSound();
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -1188,16 +1188,16 @@ void LoginDisplayHostWebUI::SetOobeProgressBarVisible(bool visible) { ...@@ -1188,16 +1188,16 @@ void LoginDisplayHostWebUI::SetOobeProgressBarVisible(bool visible) {
GetOobeUI()->ShowOobeUI(visible); GetOobeUI()->ShowOobeUI(visible);
} }
void LoginDisplayHostWebUI::TryToPlayStartupSound() { void LoginDisplayHostWebUI::TryToPlayOobeStartupSound() {
if (is_voice_interaction_oobe_) if (is_voice_interaction_oobe_)
return; return;
if (startup_sound_played_ || login_prompt_visible_time_.is_null() || if (oobe_startup_sound_played_ || login_prompt_visible_time_.is_null() ||
!CrasAudioHandler::Get()->GetPrimaryActiveOutputNode()) { !CrasAudioHandler::Get()->GetPrimaryActiveOutputNode()) {
return; return;
} }
startup_sound_played_ = true; oobe_startup_sound_played_ = true;
// Don't try play startup sound if login prompt is already visible // Don't try play startup sound if login prompt is already visible
// for a long time or can't be played. // for a long time or can't be played.
...@@ -1214,7 +1214,7 @@ void LoginDisplayHostWebUI::OnLoginPromptVisible() { ...@@ -1214,7 +1214,7 @@ void LoginDisplayHostWebUI::OnLoginPromptVisible() {
if (!login_prompt_visible_time_.is_null()) if (!login_prompt_visible_time_.is_null())
return; return;
login_prompt_visible_time_ = base::TimeTicks::Now(); login_prompt_visible_time_ = base::TimeTicks::Now();
TryToPlayStartupSound(); TryToPlayOobeStartupSound();
} }
// static // static
......
...@@ -178,7 +178,7 @@ class LoginDisplayHostWebUI : public LoginDisplayHost, ...@@ -178,7 +178,7 @@ class LoginDisplayHostWebUI : public LoginDisplayHost,
// Tries to play startup sound. If sound can't be played right now, // Tries to play startup sound. If sound can't be played right now,
// for instance, because cras server is not initialized, playback // for instance, because cras server is not initialized, playback
// will be delayed. // will be delayed.
void TryToPlayStartupSound(); void TryToPlayOobeStartupSound();
// Called when login-prompt-visible signal is caught. // Called when login-prompt-visible signal is caught.
void OnLoginPromptVisible(); void OnLoginPromptVisible();
...@@ -279,7 +279,7 @@ class LoginDisplayHostWebUI : public LoginDisplayHost, ...@@ -279,7 +279,7 @@ class LoginDisplayHostWebUI : public LoginDisplayHost,
// True when request to play startup sound was sent to // True when request to play startup sound was sent to
// SoundsManager. // SoundsManager.
// After OOBE is completed, this is always initialized with true. // After OOBE is completed, this is always initialized with true.
bool startup_sound_played_ = false; bool oobe_startup_sound_played_ = false;
// Keeps a copy of the old Drag'n'Drop client, so that it would be disabled // Keeps a copy of the old Drag'n'Drop client, so that it would be disabled
// during a login session and restored afterwards. // during a login session and restored afterwards.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment