| 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" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 void ResetKeyboardOverscrollOverride() { | 242 void ResetKeyboardOverscrollOverride() { |
| 243 keyboard::SetKeyboardOverscrollOverride( | 243 keyboard::SetKeyboardOverscrollOverride( |
| 244 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_NONE); | 244 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_NONE); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace | 247 } // namespace |
| 248 | 248 |
| 249 namespace chromeos { | 249 namespace chromeos { |
| 250 | 250 |
| 251 // static | 251 // static |
| 252 LoginDisplayHost* LoginDisplayHostImpl::default_host_ = NULL; | |
| 253 | |
| 254 // static | |
| 255 const int LoginDisplayHostImpl::kShowLoginWebUIid = 0x1111; | 252 const int LoginDisplayHostImpl::kShowLoginWebUIid = 0x1111; |
| 256 | 253 |
| 257 //////////////////////////////////////////////////////////////////////////////// | 254 //////////////////////////////////////////////////////////////////////////////// |
| 258 // LoginDisplayHostImpl, public | 255 // LoginDisplayHostImpl, public |
| 259 | 256 |
| 260 LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) | 257 LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds) |
| 261 : background_bounds_(background_bounds), | 258 : background_bounds_(background_bounds), |
| 262 shutting_down_(false), | 259 shutting_down_(false), |
| 263 oobe_progress_bar_visible_(false), | 260 oobe_progress_bar_visible_(false), |
| 264 session_starting_(false), | 261 session_starting_(false), |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 // a browser window exists and the window can acquire input focus. | 296 // a browser window exists and the window can acquire input focus. |
| 300 registrar_.Add(this, | 297 registrar_.Add(this, |
| 301 chrome::NOTIFICATION_BROWSER_OPENED, | 298 chrome::NOTIFICATION_BROWSER_OPENED, |
| 302 content::NotificationService::AllSources()); | 299 content::NotificationService::AllSources()); |
| 303 | 300 |
| 304 // Login screen is moved to lock screen container when user logs in. | 301 // Login screen is moved to lock screen container when user logs in. |
| 305 registrar_.Add(this, | 302 registrar_.Add(this, |
| 306 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 303 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| 307 content::NotificationService::AllSources()); | 304 content::NotificationService::AllSources()); |
| 308 | 305 |
| 309 DCHECK(default_host_ == NULL); | 306 DCHECK(default_host() == nullptr); |
| 310 default_host_ = this; | 307 default_host_ = this; |
| 311 | 308 |
| 312 // Make sure chrome won't exit while we are at login/oobe screen. | 309 // Make sure chrome won't exit while we are at login/oobe screen. |
| 313 chrome::IncrementKeepAliveCount(); | 310 chrome::IncrementKeepAliveCount(); |
| 314 | 311 |
| 315 bool is_registered = StartupUtils::IsDeviceRegistered(); | 312 bool is_registered = StartupUtils::IsDeviceRegistered(); |
| 316 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); | 313 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); |
| 317 bool disable_boot_animation = | 314 bool disable_boot_animation = |
| 318 base::CommandLine::ForCurrentProcess()->HasSwitch( | 315 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 319 switches::kDisableBootAnimation); | 316 switches::kDisableBootAnimation); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 login_window_->RemoveRemovalsObserver(this); | 392 login_window_->RemoveRemovalsObserver(this); |
| 396 | 393 |
| 397 ResetKeyboardOverscrollOverride(); | 394 ResetKeyboardOverscrollOverride(); |
| 398 | 395 |
| 399 views::FocusManager::set_arrow_key_traversal_enabled(false); | 396 views::FocusManager::set_arrow_key_traversal_enabled(false); |
| 400 ResetLoginWindowAndView(); | 397 ResetLoginWindowAndView(); |
| 401 | 398 |
| 402 // Let chrome process exit after login/oobe screen if needed. | 399 // Let chrome process exit after login/oobe screen if needed. |
| 403 chrome::DecrementKeepAliveCount(); | 400 chrome::DecrementKeepAliveCount(); |
| 404 | 401 |
| 405 default_host_ = NULL; | 402 default_host_ = nullptr; |
| 406 // TODO(tengs): This should be refactored. See crbug.com/314934. | 403 // TODO(tengs): This should be refactored. See crbug.com/314934. |
| 407 if (user_manager::UserManager::Get()->IsCurrentUserNew()) { | 404 if (user_manager::UserManager::Get()->IsCurrentUserNew()) { |
| 408 // DriveOptInController will delete itself when finished. | 405 // DriveOptInController will delete itself when finished. |
| 409 (new DriveFirstRunController( | 406 (new DriveFirstRunController( |
| 410 ProfileManager::GetActiveUserProfile()))->EnableOfflineMode(); | 407 ProfileManager::GetActiveUserProfile()))->EnableOfflineMode(); |
| 411 } | 408 } |
| 412 } | 409 } |
| 413 | 410 |
| 414 //////////////////////////////////////////////////////////////////////////////// | 411 //////////////////////////////////////////////////////////////////////////////// |
| 415 // LoginDisplayHostImpl, LoginDisplayHost implementation: | 412 // LoginDisplayHostImpl, LoginDisplayHost implementation: |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 | 1264 |
| 1268 locale_util::SwitchLanguageCallback callback( | 1265 locale_util::SwitchLanguageCallback callback( |
| 1269 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); | 1266 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); |
| 1270 | 1267 |
| 1271 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1268 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1272 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 1269 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |
| 1273 callback, ProfileManager::GetActiveUserProfile()); | 1270 callback, ProfileManager::GetActiveUserProfile()); |
| 1274 } | 1271 } |
| 1275 | 1272 |
| 1276 } // namespace chromeos | 1273 } // namespace chromeos |
| OLD | NEW |