Chromium Code Reviews| Index: chrome/browser/chromeos/login/dom_login_display.cc |
| diff --git a/chrome/browser/chromeos/login/dom_login_display.cc b/chrome/browser/chromeos/login/dom_login_display.cc |
| index 008b2c7a4b7cd2346123eee5b76e3fc8f6ecfd96..ece00fe1af657c2a97e5acc7470ddb00e49dc766 100644 |
| --- a/chrome/browser/chromeos/login/dom_login_display.cc |
| +++ b/chrome/browser/chromeos/login/dom_login_display.cc |
| @@ -4,10 +4,10 @@ |
| #include "chrome/browser/chromeos/login/dom_login_display.h" |
| -#include "chrome/browser/chromeos/frame/dom_browser.h" |
| #include "chrome/browser/chromeos/wm_ipc.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/ui/browser_window.h" |
| +#include "views/widget/widget.h" |
| namespace { |
| const char kLoginURL[] = "chrome://login"; |
| @@ -18,8 +18,8 @@ namespace chromeos { |
| // DOMLoginDisplay, public: --------------------------------------------------- |
| DOMLoginDisplay::~DOMLoginDisplay() { |
| - if (login_screen_) |
| - login_screen_->CloseWindow(); |
| + if (webui_login_window_.get()) |
| + webui_login_window_->Close(); |
|
oshima
2011/05/18 18:24:54
if you want to keep scoped_ptr, you have to releas
rharrison
2011/05/19 00:31:43
Removed the scoped ptr
|
| } |
| // DOMLoginDisplay, Singleton implementation: ---------------------------------- |
| @@ -31,9 +31,18 @@ DOMLoginDisplay* DOMLoginDisplay::GetInstance() { |
| // LoginDisplay implementation: ------------------------------------------------ |
| +// static |
| +views::Widget* DOMLoginDisplay::GetCurrentLoginWindow() { |
| + |
|
Ben Goodger (Google)
2011/05/18 16:50:51
nit: delete the empty line
rharrison
2011/05/19 00:31:43
Done.
|
| + return DOMLoginDisplay::GetInstance()->LoginWindow(); |
| +} |
| + |
| void DOMLoginDisplay::Destroy() { |
| background_bounds_ = gfx::Rect(); |
| delegate_ = NULL; |
| + |
| + webui_login_window_.reset(NULL); |
|
Ben Goodger (Google)
2011/05/18 16:50:51
nit: reset() works
oshima
2011/05/18 18:24:54
Don't you have to Close it?
rharrison
2011/05/19 00:31:43
This correct, my mistake.
rharrison
2011/05/19 00:31:43
I changed this to a normal pointer instead of a sc
|
| + webui_login_view_ = NULL; |
| } |
| void DOMLoginDisplay::Init(const std::vector<UserManager::User>& users, |
| @@ -45,10 +54,11 @@ void DOMLoginDisplay::Init(const std::vector<UserManager::User>& users, |
| // TODO(rharrison): Add mechanism to pass in the show_guest and show_new_user |
| // values. |
| - login_screen_ = DOMBrowser::CreateForDOM(ProfileManager::GetDefaultProfile()); |
| - login_screen_->AddSelectedTabWithURL(GURL(kLoginURL), |
| - PageTransition::START_PAGE); |
| - login_screen_->window()->Show(); |
| + webui_login_window_.reset( |
| + WebUILoginView::CreateWindowContainingView(background_bounds_, |
| + GURL(kLoginURL), |
| + &webui_login_view_)); |
| + webui_login_window_->Show(); |
| } |
| void DOMLoginDisplay::OnBeforeUserRemoved(const std::string& username) { |
| @@ -104,6 +114,9 @@ void DOMLoginDisplay::LoginAsGuest() { |
| DOMLoginDisplay::DOMLoginDisplay() |
| : LoginDisplay(NULL, gfx::Rect()), |
| LoginUIHandlerDelegate(), |
| - login_screen_(NULL) {} |
| + webui_login_window_(NULL) { |
| + |
| +} |
| + |
| } // namespace chromeos |