| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/desktop_background/desktop_background_controller.h" | 9 #include "ash/desktop_background/desktop_background_controller.h" |
| 10 #include "ash/desktop_background/user_wallpaper_delegate.h" | 10 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/shell_window_ids.h" | 12 #include "ash/shell_window_ids.h" |
| 13 #include "ash/wm/header_painter.h" | 13 #include "ash/wm/header_painter.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/debug/trace_event.h" | 16 #include "base/debug/trace_event.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/threading/thread_restrictions.h" | 20 #include "base/threading/thread_restrictions.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "base/values.h" | 22 #include "base/values.h" |
| 23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
| 24 #include "chrome/browser/browser_shutdown.h" | 24 #include "chrome/browser/browser_shutdown.h" |
| 25 #include "chrome/browser/chrome_notification_types.h" | 25 #include "chrome/browser/chrome_notification_types.h" |
| 26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 26 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 27 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 27 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 28 #include "chrome/browser/chromeos/customization_document.h" | 28 #include "chrome/browser/chromeos/customization_document.h" |
| 29 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" |
| 29 #include "chrome/browser/chromeos/first_run/first_run_controller.h" | 30 #include "chrome/browser/chromeos/first_run/first_run_controller.h" |
| 30 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 31 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 31 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 32 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
| 32 #include "chrome/browser/chromeos/language_preferences.h" | 33 #include "chrome/browser/chromeos/language_preferences.h" |
| 33 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 34 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 34 #include "chrome/browser/chromeos/login/helper.h" | 35 #include "chrome/browser/chromeos/login/helper.h" |
| 35 #include "chrome/browser/chromeos/login/keyboard_driven_oobe_key_handler.h" | 36 #include "chrome/browser/chromeos/login/keyboard_driven_oobe_key_handler.h" |
| 36 #include "chrome/browser/chromeos/login/language_switch_menu.h" | 37 #include "chrome/browser/chromeos/login/language_switch_menu.h" |
| 37 #include "chrome/browser/chromeos/login/login_utils.h" | 38 #include "chrome/browser/chromeos/login/login_utils.h" |
| 38 #include "chrome/browser/chromeos/login/login_wizard.h" | 39 #include "chrome/browser/chromeos/login/login_wizard.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 chrome::EndKeepAlive(); | 311 chrome::EndKeepAlive(); |
| 311 | 312 |
| 312 default_host_ = NULL; | 313 default_host_ = NULL; |
| 313 // TODO(dzhioev): find better place for starting tutorial. | 314 // TODO(dzhioev): find better place for starting tutorial. |
| 314 if (CommandLine::ForCurrentProcess()-> | 315 if (CommandLine::ForCurrentProcess()-> |
| 315 HasSwitch(switches::kEnableFirstRunUI)) { | 316 HasSwitch(switches::kEnableFirstRunUI)) { |
| 316 // FirstRunController manages its lifetime and destructs after tutorial | 317 // FirstRunController manages its lifetime and destructs after tutorial |
| 317 // completion. | 318 // completion. |
| 318 (new FirstRunController())->Start(); | 319 (new FirstRunController())->Start(); |
| 319 } | 320 } |
| 321 |
| 322 // TODO(tengs): This should be refactored together with the first run UI. |
| 323 // See crbug.com/314934. |
| 324 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 325 switches::kEnableDriveOfflineFirstRun)) { |
| 326 if (UserManager::Get()->IsCurrentUserNew()) { |
| 327 // DriveOptInController will delete itself when finished. |
| 328 (new DriveFirstRunController())->EnableOfflineMode(); |
| 329 } |
| 330 } |
| 320 } | 331 } |
| 321 | 332 |
| 322 //////////////////////////////////////////////////////////////////////////////// | 333 //////////////////////////////////////////////////////////////////////////////// |
| 323 // LoginDisplayHostImpl, LoginDisplayHost implementation: | 334 // LoginDisplayHostImpl, LoginDisplayHost implementation: |
| 324 | 335 |
| 325 LoginDisplay* LoginDisplayHostImpl::CreateLoginDisplay( | 336 LoginDisplay* LoginDisplayHostImpl::CreateLoginDisplay( |
| 326 LoginDisplay::Delegate* delegate) { | 337 LoginDisplay::Delegate* delegate) { |
| 327 webui_login_display_ = new WebUILoginDisplay(delegate); | 338 webui_login_display_ = new WebUILoginDisplay(delegate); |
| 328 webui_login_display_->set_background_bounds(background_bounds()); | 339 webui_login_display_->set_background_bounds(background_bounds()); |
| 329 return webui_login_display_; | 340 return webui_login_display_; |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 VLOG(1) << "Initial time zone: " << timezone_name; | 1141 VLOG(1) << "Initial time zone: " << timezone_name; |
| 1131 // Apply locale customizations only once to preserve whatever locale | 1142 // Apply locale customizations only once to preserve whatever locale |
| 1132 // user has changed to during OOBE. | 1143 // user has changed to during OOBE. |
| 1133 if (!timezone_name.empty()) { | 1144 if (!timezone_name.empty()) { |
| 1134 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 1145 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 1135 UTF8ToUTF16(timezone_name)); | 1146 UTF8ToUTF16(timezone_name)); |
| 1136 } | 1147 } |
| 1137 } | 1148 } |
| 1138 | 1149 |
| 1139 } // namespace chromeos | 1150 } // namespace chromeos |
| OLD | NEW |