| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/chromeos/login/oobe_display.h" | 8 #include "chrome/browser/chromeos/login/oobe_display.h" |
| 9 #include "chrome/browser/chromeos/login/webui_login_display.h" | 9 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 10 #include "chrome/browser/chromeos/login/webui_login_view.h" | 10 #include "chrome/browser/chromeos/login/webui_login_view.h" |
| 11 #include "chrome/browser/chromeos/login/touch_login_view.h" | |
| 12 #include "chrome/browser/chromeos/login/wizard_controller.h" | 11 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 13 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 12 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 14 #include "views/widget/widget.h" | 13 #include "views/widget/widget.h" |
| 15 | 14 |
| 16 namespace chromeos { | 15 namespace chromeos { |
| 17 | 16 |
| 18 namespace { | 17 namespace { |
| 19 | 18 |
| 20 // URL which corresponds to the login WebUI. | 19 // URL which corresponds to the login WebUI. |
| 21 const char kLoginURL[] = "chrome://login"; | 20 const char kLoginURL[] = "chrome://login"; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 111 } |
| 113 | 112 |
| 114 void WebUILoginDisplayHost::LoadURL(const GURL& url) { | 113 void WebUILoginDisplayHost::LoadURL(const GURL& url) { |
| 115 if (!login_window_) { | 114 if (!login_window_) { |
| 116 views::Widget::InitParams params( | 115 views::Widget::InitParams params( |
| 117 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 116 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 118 params.bounds = background_bounds(); | 117 params.bounds = background_bounds(); |
| 119 | 118 |
| 120 login_window_ = new views::Widget; | 119 login_window_ = new views::Widget; |
| 121 login_window_->Init(params); | 120 login_window_->Init(params); |
| 122 #if defined(TOUCH_UI) | |
| 123 login_view_ = new TouchLoginView(); | |
| 124 #else | |
| 125 login_view_ = new WebUILoginView(); | 121 login_view_ = new WebUILoginView(); |
| 126 #endif | |
| 127 | 122 |
| 128 login_view_->Init(); | 123 login_view_->Init(); |
| 129 login_window_->SetContentsView(login_view_); | 124 login_window_->SetContentsView(login_view_); |
| 130 login_view_->UpdateWindowType(); | 125 login_view_->UpdateWindowType(); |
| 131 | 126 |
| 132 login_window_->Show(); | 127 login_window_->Show(); |
| 133 WebUILoginDisplay::GetInstance()->set_login_window(login_window_); | 128 WebUILoginDisplay::GetInstance()->set_login_window(login_window_); |
| 134 login_view_->OnWindowCreated(); | 129 login_view_->OnWindowCreated(); |
| 135 } | 130 } |
| 136 login_view_->LoadURL(url); | 131 login_view_->LoadURL(url); |
| 137 } | 132 } |
| 138 | 133 |
| 139 OobeUI* WebUILoginDisplayHost::GetOobeUI() const { | 134 OobeUI* WebUILoginDisplayHost::GetOobeUI() const { |
| 140 return static_cast<OobeUI*>(login_view_->GetWebUI()); | 135 return static_cast<OobeUI*>(login_view_->GetWebUI()); |
| 141 } | 136 } |
| 142 | 137 |
| 143 WizardController* WebUILoginDisplayHost::CreateWizardController() { | 138 WizardController* WebUILoginDisplayHost::CreateWizardController() { |
| 144 // TODO(altimofeev): ensure that WebUI is ready. | 139 // TODO(altimofeev): ensure that WebUI is ready. |
| 145 OobeDisplay* oobe_display = GetOobeUI(); | 140 OobeDisplay* oobe_display = GetOobeUI(); |
| 146 return new WizardController(this, oobe_display); | 141 return new WizardController(this, oobe_display); |
| 147 } | 142 } |
| 148 | 143 |
| 149 } // namespace chromeos | 144 } // namespace chromeos |
| OLD | NEW |