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

Side by Side Diff: chrome/browser/chromeos/login/ui/login_display_host_impl.cc

Issue 2142463002: ash: Remove media dependency from ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops 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 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 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/audio/sounds.h"
11 #include "ash/common/shell_window_ids.h" 10 #include "ash/common/shell_window_ids.h"
12 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
13 #include "ash/desktop_background/desktop_background_controller.h" 12 #include "ash/desktop_background/desktop_background_controller.h"
14 #include "ash/desktop_background/user_wallpaper_delegate.h" 13 #include "ash/desktop_background/user_wallpaper_delegate.h"
15 #include "ash/shell.h" 14 #include "ash/shell.h"
16 #include "base/bind.h" 15 #include "base/bind.h"
17 #include "base/command_line.h" 16 #include "base/command_line.h"
18 #include "base/location.h" 17 #include "base/location.h"
19 #include "base/logging.h" 18 #include "base/logging.h"
20 #include "base/macros.h" 19 #include "base/macros.h"
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 1218
1220 // Don't try play startup sound if login prompt is already visible 1219 // Don't try play startup sound if login prompt is already visible
1221 // for a long time or can't be played. 1220 // for a long time or can't be played.
1222 if (base::TimeTicks::Now() - login_prompt_visible_time_ > 1221 if (base::TimeTicks::Now() - login_prompt_visible_time_ >
1223 base::TimeDelta::FromMilliseconds(kStartupSoundMaxDelayMs)) { 1222 base::TimeDelta::FromMilliseconds(kStartupSoundMaxDelayMs)) {
1224 EnableSystemSoundsForAccessibility(); 1223 EnableSystemSoundsForAccessibility();
1225 return; 1224 return;
1226 } 1225 }
1227 1226
1228 if (!startup_sound_honors_spoken_feedback_ && 1227 if (!startup_sound_honors_spoken_feedback_ &&
1229 !ash::PlaySystemSoundAlways(SOUND_STARTUP)) { 1228 !AccessibilityManager::Get()->PlayEarcon(SOUND_STARTUP,
1229 PlaySoundOption::ALWAYS)) {
1230 EnableSystemSoundsForAccessibility(); 1230 EnableSystemSoundsForAccessibility();
1231 return; 1231 return;
1232 } 1232 }
1233 1233
1234 if (startup_sound_honors_spoken_feedback_ && 1234 if (startup_sound_honors_spoken_feedback_ &&
1235 !ash::PlaySystemSoundIfSpokenFeedback(SOUND_STARTUP)) { 1235 !AccessibilityManager::Get()->PlayEarcon(
1236 SOUND_STARTUP, PlaySoundOption::SPOKEN_FEEDBACK_ENABLED)) {
1236 EnableSystemSoundsForAccessibility(); 1237 EnableSystemSoundsForAccessibility();
1237 return; 1238 return;
1238 } 1239 }
1239 1240
1240 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 1241 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
1241 FROM_HERE, base::Bind(&EnableSystemSoundsForAccessibility), 1242 FROM_HERE, base::Bind(&EnableSystemSoundsForAccessibility),
1242 media::SoundsManager::Get()->GetDuration(SOUND_STARTUP)); 1243 media::SoundsManager::Get()->GetDuration(SOUND_STARTUP));
1243 } 1244 }
1244 1245
1245 void LoginDisplayHostImpl::OnLoginPromptVisible() { 1246 void LoginDisplayHostImpl::OnLoginPromptVisible() {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 1384
1384 locale_util::SwitchLanguageCallback callback( 1385 locale_util::SwitchLanguageCallback callback(
1385 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); 1386 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data))));
1386 1387
1387 // Load locale keyboards here. Hardware layout would be automatically enabled. 1388 // Load locale keyboards here. Hardware layout would be automatically enabled.
1388 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, 1389 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */,
1389 callback, ProfileManager::GetActiveUserProfile()); 1390 callback, ProfileManager::GetActiveUserProfile());
1390 } 1391 }
1391 1392
1392 } // namespace chromeos 1393 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/lock/screen_locker.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698