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

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

Issue 2033753002: Remove use of deprecated MessageLoop methods in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: manual change Created 4 years, 6 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" 10 #include "ash/audio/sounds.h"
11 #include "ash/desktop_background/desktop_background_controller.h" 11 #include "ash/desktop_background/desktop_background_controller.h"
12 #include "ash/desktop_background/user_wallpaper_delegate.h" 12 #include "ash/desktop_background/user_wallpaper_delegate.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "ash/shell_window_ids.h" 14 #include "ash/shell_window_ids.h"
15 #include "base/bind.h" 15 #include "base/bind.h"
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/location.h"
17 #include "base/logging.h" 18 #include "base/logging.h"
18 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "base/single_thread_task_runner.h"
19 #include "base/strings/string_split.h" 21 #include "base/strings/string_split.h"
20 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
21 #include "base/threading/thread_restrictions.h" 23 #include "base/threading/thread_restrictions.h"
24 #include "base/threading/thread_task_runner_handle.h"
22 #include "base/time/time.h" 25 #include "base/time/time.h"
23 #include "base/trace_event/trace_event.h" 26 #include "base/trace_event/trace_event.h"
24 #include "chrome/browser/browser_process.h" 27 #include "chrome/browser/browser_process.h"
25 #include "chrome/browser/browser_shutdown.h" 28 #include "chrome/browser/browser_shutdown.h"
26 #include "chrome/browser/chrome_notification_types.h" 29 #include "chrome/browser/chrome_notification_types.h"
27 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 30 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
28 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 31 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
29 #include "chrome/browser/chromeos/base/locale_util.h" 32 #include "chrome/browser/chromeos/base/locale_util.h"
30 #include "chrome/browser/chromeos/boot_times_recorder.h" 33 #include "chrome/browser/chromeos/boot_times_recorder.h"
31 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" 34 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h"
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 1007
1005 //////////////////////////////////////////////////////////////////////////////// 1008 ////////////////////////////////////////////////////////////////////////////////
1006 // LoginDisplayHostImpl, private 1009 // LoginDisplayHostImpl, private
1007 1010
1008 void LoginDisplayHostImpl::ShutdownDisplayHost(bool post_quit_task) { 1011 void LoginDisplayHostImpl::ShutdownDisplayHost(bool post_quit_task) {
1009 if (shutting_down_) 1012 if (shutting_down_)
1010 return; 1013 return;
1011 1014
1012 shutting_down_ = true; 1015 shutting_down_ = true;
1013 registrar_.RemoveAll(); 1016 registrar_.RemoveAll();
1014 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); 1017 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
1015 if (post_quit_task) 1018 if (post_quit_task)
1016 base::MessageLoop::current()->QuitWhenIdle(); 1019 base::MessageLoop::current()->QuitWhenIdle();
1017 1020
1018 if (!completion_callback_.is_null()) 1021 if (!completion_callback_.is_null())
1019 base::MessageLoop::current()->PostTask(FROM_HERE, completion_callback_); 1022 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
1023 completion_callback_);
1020 1024
1021 if (ash::Shell::HasInstance() && 1025 if (ash::Shell::HasInstance() &&
1022 finalize_animation_type_ == ANIMATION_ADD_USER) { 1026 finalize_animation_type_ == ANIMATION_ADD_USER) {
1023 if (!chrome::IsRunningInMash()) { 1027 if (!chrome::IsRunningInMash()) {
1024 ash::Shell::GetInstance() 1028 ash::Shell::GetInstance()
1025 ->desktop_background_controller() 1029 ->desktop_background_controller()
1026 ->MoveDesktopToUnlockedContainer(); 1030 ->MoveDesktopToUnlockedContainer();
1027 } else { 1031 } else {
1028 NOTIMPLEMENTED(); 1032 NOTIMPLEMENTED();
1029 } 1033 }
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 EnableSystemSoundsForAccessibility(); 1233 EnableSystemSoundsForAccessibility();
1230 return; 1234 return;
1231 } 1235 }
1232 1236
1233 if (startup_sound_honors_spoken_feedback_ && 1237 if (startup_sound_honors_spoken_feedback_ &&
1234 !ash::PlaySystemSoundIfSpokenFeedback(SOUND_STARTUP)) { 1238 !ash::PlaySystemSoundIfSpokenFeedback(SOUND_STARTUP)) {
1235 EnableSystemSoundsForAccessibility(); 1239 EnableSystemSoundsForAccessibility();
1236 return; 1240 return;
1237 } 1241 }
1238 1242
1239 base::MessageLoop::current()->PostDelayedTask( 1243 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
1240 FROM_HERE, 1244 FROM_HERE, base::Bind(&EnableSystemSoundsForAccessibility),
1241 base::Bind(&EnableSystemSoundsForAccessibility),
1242 media::SoundsManager::Get()->GetDuration(SOUND_STARTUP)); 1245 media::SoundsManager::Get()->GetDuration(SOUND_STARTUP));
1243 } 1246 }
1244 1247
1245 void LoginDisplayHostImpl::OnLoginPromptVisible() { 1248 void LoginDisplayHostImpl::OnLoginPromptVisible() {
1246 if (!login_prompt_visible_time_.is_null()) 1249 if (!login_prompt_visible_time_.is_null())
1247 return; 1250 return;
1248 login_prompt_visible_time_ = base::TimeTicks::Now(); 1251 login_prompt_visible_time_ = base::TimeTicks::Now();
1249 TryToPlayStartupSound(); 1252 TryToPlayStartupSound();
1250 } 1253 }
1251 1254
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 1386
1384 locale_util::SwitchLanguageCallback callback( 1387 locale_util::SwitchLanguageCallback callback(
1385 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); 1388 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data))));
1386 1389
1387 // Load locale keyboards here. Hardware layout would be automatically enabled. 1390 // Load locale keyboards here. Hardware layout would be automatically enabled.
1388 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, 1391 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */,
1389 callback, ProfileManager::GetActiveUserProfile()); 1392 callback, ProfileManager::GetActiveUserProfile());
1390 } 1393 }
1391 1394
1392 } // namespace chromeos 1395 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/captive_portal_window_browsertest.cc ('k') | chrome/browser/chromeos/login/user_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698