| OLD | NEW |
| 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/common/shell_window_ids.h" | 11 #include "ash/common/shell_window_ids.h" |
| 12 #include "ash/common/wm_shell.h" |
| 12 #include "ash/desktop_background/desktop_background_controller.h" | 13 #include "ash/desktop_background/desktop_background_controller.h" |
| 13 #include "ash/desktop_background/user_wallpaper_delegate.h" | 14 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 14 #include "ash/shell.h" | 15 #include "ash/shell.h" |
| 15 #include "base/bind.h" | 16 #include "base/bind.h" |
| 16 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 17 #include "base/location.h" | 18 #include "base/location.h" |
| 18 #include "base/logging.h" | 19 #include "base/logging.h" |
| 19 #include "base/macros.h" | 20 #include "base/macros.h" |
| 20 #include "base/single_thread_task_runner.h" | 21 #include "base/single_thread_task_runner.h" |
| 21 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 initialize_webui_hidden_ = false; | 293 initialize_webui_hidden_ = false; |
| 293 } | 294 } |
| 294 | 295 |
| 295 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); | 296 DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); |
| 296 CrasAudioHandler::Get()->AddAudioObserver(this); | 297 CrasAudioHandler::Get()->AddAudioObserver(this); |
| 297 if (keyboard::KeyboardController::GetInstance()) { | 298 if (keyboard::KeyboardController::GetInstance()) { |
| 298 keyboard::KeyboardController::GetInstance()->AddObserver(this); | 299 keyboard::KeyboardController::GetInstance()->AddObserver(this); |
| 299 is_observing_keyboard_ = true; | 300 is_observing_keyboard_ = true; |
| 300 } | 301 } |
| 301 | 302 |
| 302 if (!chrome::IsRunningInMash()) { | 303 if (!chrome::IsRunningInMash()) |
| 303 ash::Shell::GetInstance()->delegate()->AddVirtualKeyboardStateObserver( | 304 ash::WmShell::Get()->delegate()->AddVirtualKeyboardStateObserver(this); |
| 304 this); | 305 else |
| 305 } else { | |
| 306 NOTIMPLEMENTED(); | 306 NOTIMPLEMENTED(); |
| 307 } | |
| 308 display::Screen::GetScreen()->AddObserver(this); | 307 display::Screen::GetScreen()->AddObserver(this); |
| 309 | 308 |
| 310 // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATING | 309 // We need to listen to CLOSE_ALL_BROWSERS_REQUEST but not APP_TERMINATING |
| 311 // because/ APP_TERMINATING will never be fired as long as this keeps | 310 // because/ APP_TERMINATING will never be fired as long as this keeps |
| 312 // ref-count. CLOSE_ALL_BROWSERS_REQUEST is safe here because there will be no | 311 // ref-count. CLOSE_ALL_BROWSERS_REQUEST is safe here because there will be no |
| 313 // browser instance that will block the shutdown. | 312 // browser instance that will block the shutdown. |
| 314 registrar_.Add(this, | 313 registrar_.Add(this, |
| 315 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 314 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 316 content::NotificationService::AllSources()); | 315 content::NotificationService::AllSources()); |
| 317 | 316 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 } | 412 } |
| 414 | 413 |
| 415 LoginDisplayHostImpl::~LoginDisplayHostImpl() { | 414 LoginDisplayHostImpl::~LoginDisplayHostImpl() { |
| 416 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this); | 415 DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this); |
| 417 CrasAudioHandler::Get()->RemoveAudioObserver(this); | 416 CrasAudioHandler::Get()->RemoveAudioObserver(this); |
| 418 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { | 417 if (keyboard::KeyboardController::GetInstance() && is_observing_keyboard_) { |
| 419 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); | 418 keyboard::KeyboardController::GetInstance()->RemoveObserver(this); |
| 420 is_observing_keyboard_ = false; | 419 is_observing_keyboard_ = false; |
| 421 } | 420 } |
| 422 | 421 |
| 423 if (!chrome::IsRunningInMash()) { | 422 if (!chrome::IsRunningInMash()) |
| 424 ash::Shell::GetInstance()->delegate()->RemoveVirtualKeyboardStateObserver( | 423 ash::WmShell::Get()->delegate()->RemoveVirtualKeyboardStateObserver(this); |
| 425 this); | 424 else |
| 426 } else { | |
| 427 NOTIMPLEMENTED(); | 425 NOTIMPLEMENTED(); |
| 428 } | |
| 429 display::Screen::GetScreen()->RemoveObserver(this); | 426 display::Screen::GetScreen()->RemoveObserver(this); |
| 430 | 427 |
| 431 if (login_view_ && login_window_) | 428 if (login_view_ && login_window_) |
| 432 login_window_->RemoveRemovalsObserver(this); | 429 login_window_->RemoveRemovalsObserver(this); |
| 433 | 430 |
| 434 chrome::MultiUserWindowManager* window_manager = | 431 chrome::MultiUserWindowManager* window_manager = |
| 435 chrome::MultiUserWindowManager::GetInstance(); | 432 chrome::MultiUserWindowManager::GetInstance(); |
| 436 // MultiUserWindowManager instance might be null if no user is logged in - or | 433 // MultiUserWindowManager instance might be null if no user is logged in - or |
| 437 // in a unit test. | 434 // in a unit test. |
| 438 if (window_manager) | 435 if (window_manager) |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 | 1383 |
| 1387 locale_util::SwitchLanguageCallback callback( | 1384 locale_util::SwitchLanguageCallback callback( |
| 1388 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); | 1385 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); |
| 1389 | 1386 |
| 1390 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1387 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1391 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 1388 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |
| 1392 callback, ProfileManager::GetActiveUserProfile()); | 1389 callback, ProfileManager::GetActiveUserProfile()); |
| 1393 } | 1390 } |
| 1394 | 1391 |
| 1395 } // namespace chromeos | 1392 } // namespace chromeos |
| OLD | NEW |