| 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/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/window_animations.h" | 9 #include "ash/wm/window_animations.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 13 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
| 14 #include "chrome/browser/chromeos/login/oobe_display.h" | 14 #include "chrome/browser/chromeos/login/oobe_display.h" |
| 15 #include "chrome/browser/chromeos/login/webui_login_display.h" | 15 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 16 #include "chrome/browser/chromeos/login/webui_login_view.h" | 16 #include "chrome/browser/chromeos/login/webui_login_view.h" |
| 17 #include "chrome/browser/chromeos/login/wizard_controller.h" | 17 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 18 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 18 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 19 #include "chrome/common/chrome_switches.h" |
| 19 #include "content/public/browser/web_ui.h" | 20 #include "content/public/browser/web_ui.h" |
| 20 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 21 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
| 22 | 23 |
| 23 namespace chromeos { | 24 namespace chromeos { |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| 26 | 27 |
| 27 // URL which corresponds to the login WebUI. | 28 // URL which corresponds to the login WebUI. |
| 28 const char kLoginURL[] = "chrome://oobe/login"; | 29 const char kLoginURL[] = "chrome://oobe/login"; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 login_view_ = NULL; | 143 login_view_ = NULL; |
| 143 } | 144 } |
| 144 } | 145 } |
| 145 | 146 |
| 146 void WebUILoginDisplayHost::LoadURL(const GURL& url) { | 147 void WebUILoginDisplayHost::LoadURL(const GURL& url) { |
| 147 if (!login_window_) { | 148 if (!login_window_) { |
| 148 views::Widget::InitParams params( | 149 views::Widget::InitParams params( |
| 149 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 150 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 150 params.bounds = background_bounds(); | 151 params.bounds = background_bounds(); |
| 151 params.show_state = ui::SHOW_STATE_FULLSCREEN; | 152 params.show_state = ui::SHOW_STATE_FULLSCREEN; |
| 153 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNewOobe)) |
| 154 params.transparent = true; |
| 152 params.parent = | 155 params.parent = |
| 153 ash::Shell::GetInstance()->GetContainer( | 156 ash::Shell::GetInstance()->GetContainer( |
| 154 ash::internal::kShellWindowId_LockScreenContainer); | 157 ash::internal::kShellWindowId_LockScreenContainer); |
| 155 | 158 |
| 156 login_window_ = new views::Widget; | 159 login_window_ = new views::Widget; |
| 157 login_window_->Init(params); | 160 login_window_->Init(params); |
| 158 login_view_ = new WebUILoginView(); | 161 login_view_ = new WebUILoginView(); |
| 159 | 162 |
| 160 login_view_->Init(login_window_); | 163 login_view_->Init(login_window_); |
| 161 | 164 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 180 return static_cast<OobeUI*>(login_view_->GetWebUI()->GetController()); | 183 return static_cast<OobeUI*>(login_view_->GetWebUI()->GetController()); |
| 181 } | 184 } |
| 182 | 185 |
| 183 WizardController* WebUILoginDisplayHost::CreateWizardController() { | 186 WizardController* WebUILoginDisplayHost::CreateWizardController() { |
| 184 // TODO(altimofeev): ensure that WebUI is ready. | 187 // TODO(altimofeev): ensure that WebUI is ready. |
| 185 OobeDisplay* oobe_display = GetOobeUI(); | 188 OobeDisplay* oobe_display = GetOobeUI(); |
| 186 return new WizardController(this, oobe_display); | 189 return new WizardController(this, oobe_display); |
| 187 } | 190 } |
| 188 | 191 |
| 189 } // namespace chromeos | 192 } // namespace chromeos |
| OLD | NEW |