| 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/webui_login_display_host.h" | 5 #include "chrome/browser/chromeos/login/webui_login_display_host.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/desktop_background/user_wallpaper_delegate.h" | 8 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 11 #include "ash/wm/window_animations.h" | 11 #include "ash/wm/window_animations.h" |
| 12 #include "ash/wm/window_properties.h" | 12 #include "ash/wm/window_properties.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chrome/browser/browser_shutdown.h" | 18 #include "chrome/browser/browser_shutdown.h" |
| 19 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 19 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
| 20 #include "chrome/browser/chromeos/login/oobe_display.h" | 20 #include "chrome/browser/chromeos/login/oobe_display.h" |
| 21 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 21 #include "chrome/browser/chromeos/login/webui_login_display.h" | 22 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 22 #include "chrome/browser/chromeos/login/webui_login_view.h" | 23 #include "chrome/browser/chromeos/login/webui_login_view.h" |
| 23 #include "chrome/browser/chromeos/login/wizard_controller.h" | 24 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 24 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 25 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 25 #include "chrome/common/chrome_notification_types.h" | 26 #include "chrome/common/chrome_notification_types.h" |
| 26 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 27 #include "content/public/browser/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
| 28 #include "content/public/browser/web_contents.h" | 29 #include "content/public/browser/web_contents.h" |
| 29 #include "content/public/browser/web_contents_view.h" | 30 #include "content/public/browser/web_contents_view.h" |
| 30 #include "content/public/browser/web_ui.h" | 31 #include "content/public/browser/web_ui.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 : LoginDisplayHostImpl(background_bounds), | 65 : LoginDisplayHostImpl(background_bounds), |
| 65 login_window_(NULL), | 66 login_window_(NULL), |
| 66 login_view_(NULL), | 67 login_view_(NULL), |
| 67 webui_login_display_(NULL), | 68 webui_login_display_(NULL), |
| 68 is_showing_login_(false), | 69 is_showing_login_(false), |
| 69 is_wallpaper_loaded_(false), | 70 is_wallpaper_loaded_(false), |
| 70 status_area_saved_visibility_(false), | 71 status_area_saved_visibility_(false), |
| 71 crash_count_(0), | 72 crash_count_(0), |
| 72 restore_path_(RESTORE_UNKNOWN), | 73 restore_path_(RESTORE_UNKNOWN), |
| 73 old_ignore_solo_window_frame_painter_policy_value_(false) { | 74 old_ignore_solo_window_frame_painter_policy_value_(false) { |
| 74 bool is_registered = WizardController::IsDeviceRegistered(); | 75 bool is_registered = StartupUtils::IsDeviceRegistered(); |
| 75 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); | 76 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); |
| 76 bool disable_boot_animation = CommandLine::ForCurrentProcess()-> | 77 bool disable_boot_animation = CommandLine::ForCurrentProcess()-> |
| 77 HasSwitch(switches::kDisableBootAnimation); | 78 HasSwitch(switches::kDisableBootAnimation); |
| 78 bool disable_oobe_animation = CommandLine::ForCurrentProcess()-> | 79 bool disable_oobe_animation = CommandLine::ForCurrentProcess()-> |
| 79 HasSwitch(switches::kDisableOobeAnimation); | 80 HasSwitch(switches::kDisableOobeAnimation); |
| 80 | 81 |
| 81 waiting_for_wallpaper_load_ = | 82 waiting_for_wallpaper_load_ = |
| 82 !zero_delay_enabled && | 83 !zero_delay_enabled && |
| 83 (is_registered || !disable_oobe_animation) && | 84 (is_registered || !disable_oobe_animation) && |
| 84 (!is_registered || !disable_boot_animation); | 85 (!is_registered || !disable_boot_animation); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 103 const std::string override_type = CommandLine::ForCurrentProcess()-> | 104 const std::string override_type = CommandLine::ForCurrentProcess()-> |
| 104 GetSwitchValueASCII(switches::kAshWebUIInit); | 105 GetSwitchValueASCII(switches::kAshWebUIInit); |
| 105 if (override_type == kWebUIInitParallel) | 106 if (override_type == kWebUIInitParallel) |
| 106 initialize_webui_hidden_ = true; | 107 initialize_webui_hidden_ = true; |
| 107 else if (override_type == kWebUIInitPostpone) | 108 else if (override_type == kWebUIInitPostpone) |
| 108 initialize_webui_hidden_ = false; | 109 initialize_webui_hidden_ = false; |
| 109 } | 110 } |
| 110 | 111 |
| 111 // Always postpone WebUI initialization on first boot, otherwise we miss | 112 // Always postpone WebUI initialization on first boot, otherwise we miss |
| 112 // initial animation. | 113 // initial animation. |
| 113 if (!WizardController::IsOobeCompleted()) | 114 if (!StartupUtils::IsOobeCompleted()) |
| 114 initialize_webui_hidden_ = false; | 115 initialize_webui_hidden_ = false; |
| 115 | 116 |
| 116 // There is no wallpaper for KioskMode, don't initialize the webui hidden. | 117 // There is no wallpaper for KioskMode, don't initialize the webui hidden. |
| 117 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) | 118 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) |
| 118 initialize_webui_hidden_ = false; | 119 initialize_webui_hidden_ = false; |
| 119 | 120 |
| 120 if (waiting_for_wallpaper_load_) { | 121 if (waiting_for_wallpaper_load_) { |
| 121 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 122 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
| 122 content::NotificationService::AllSources()); | 123 content::NotificationService::AllSources()); |
| 123 } | 124 } |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 root->SetProperty(ash::internal::kIgnoreSoloWindowFramePainterPolicy, | 415 root->SetProperty(ash::internal::kIgnoreSoloWindowFramePainterPolicy, |
| 415 old_ignore_solo_window_frame_painter_policy_value_); | 416 old_ignore_solo_window_frame_painter_policy_value_); |
| 416 } | 417 } |
| 417 } | 418 } |
| 418 login_window_->Close(); | 419 login_window_->Close(); |
| 419 login_window_ = NULL; | 420 login_window_ = NULL; |
| 420 login_view_ = NULL; | 421 login_view_ = NULL; |
| 421 } | 422 } |
| 422 | 423 |
| 423 } // namespace chromeos | 424 } // namespace chromeos |
| OLD | NEW |