| 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 "chrome/browser/chromeos/login/oobe_display.h" | 7 #include "chrome/browser/chromeos/login/oobe_display.h" |
| 8 #include "chrome/browser/chromeos/login/webui_login_display.h" | 8 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 9 #include "chrome/browser/chromeos/login/webui_login_view.h" | 9 #include "chrome/browser/chromeos/login/webui_login_view.h" |
| 10 #include "chrome/browser/chromeos/login/touch_login_view.h" | |
| 11 #include "chrome/browser/chromeos/login/wizard_controller.h" | 10 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 12 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 11 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 13 #include "views/widget/widget.h" | 12 #include "views/widget/widget.h" |
| 14 | 13 |
| 15 namespace chromeos { | 14 namespace chromeos { |
| 16 | 15 |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 19 // URL which corresponds to the login WebUI. | 18 // URL which corresponds to the login WebUI. |
| 20 const char kLoginURL[] = "chrome://login"; | 19 const char kLoginURL[] = "chrome://login"; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 80 } |
| 82 | 81 |
| 83 void WebUILoginDisplayHost::LoadURL(const GURL& url) { | 82 void WebUILoginDisplayHost::LoadURL(const GURL& url) { |
| 84 if (!login_window_) { | 83 if (!login_window_) { |
| 85 views::Widget::InitParams params( | 84 views::Widget::InitParams params( |
| 86 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 85 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 87 params.bounds = background_bounds(); | 86 params.bounds = background_bounds(); |
| 88 | 87 |
| 89 login_window_ = new views::Widget; | 88 login_window_ = new views::Widget; |
| 90 login_window_->Init(params); | 89 login_window_->Init(params); |
| 91 #if defined(TOUCH_UI) | |
| 92 login_view_ = new TouchLoginView(); | |
| 93 #else | |
| 94 login_view_ = new WebUILoginView(); | 90 login_view_ = new WebUILoginView(); |
| 95 #endif | |
| 96 | 91 |
| 97 login_view_->Init(); | 92 login_view_->Init(); |
| 98 login_window_->SetContentsView(login_view_); | 93 login_window_->SetContentsView(login_view_); |
| 99 login_view_->UpdateWindowType(); | 94 login_view_->UpdateWindowType(); |
| 100 | 95 |
| 101 login_window_->Show(); | 96 login_window_->Show(); |
| 102 WebUILoginDisplay::GetInstance()->set_login_window(login_window_); | 97 WebUILoginDisplay::GetInstance()->set_login_window(login_window_); |
| 103 } | 98 } |
| 104 login_view_->LoadURL(url); | 99 login_view_->LoadURL(url); |
| 105 } | 100 } |
| 106 | 101 |
| 107 WizardController* WebUILoginDisplayHost::CreateWizardController() { | 102 WizardController* WebUILoginDisplayHost::CreateWizardController() { |
| 108 // TODO(altimofeev): ensure that WebUI is ready. | 103 // TODO(altimofeev): ensure that WebUI is ready. |
| 109 OobeDisplay* oobe_display = static_cast<OobeUI*>(login_view_->GetWebUI()); | 104 OobeDisplay* oobe_display = static_cast<OobeUI*>(login_view_->GetWebUI()); |
| 110 return new WizardController(this, oobe_display); | 105 return new WizardController(this, oobe_display); |
| 111 } | 106 } |
| 112 | 107 |
| 113 } // namespace chromeos | 108 } // namespace chromeos |
| OLD | NEW |