Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/chromeos/login/webui_login_display_host.cc

Issue 7111033: Ties up OOBE controllers and WebUI handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/webui_login_display.h" 8 #include "chrome/browser/chromeos/login/webui_login_display.h"
9 #include "chrome/browser/chromeos/login/webui_login_view.h"
10 #include "chrome/browser/chromeos/login/wizard_controller.h"
11 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
12 #include "views/widget/widget.h"
8 13
9 namespace chromeos { 14 namespace chromeos {
10 15
11 // WebUILoginDisplayHost ------------------------------------------------------- 16 // WebUILoginDisplayHost -------------------------------------------------------
12 17
13 WebUILoginDisplayHost::WebUILoginDisplayHost(const gfx::Rect& background_bounds) 18 WebUILoginDisplayHost::WebUILoginDisplayHost(const gfx::Rect& background_bounds)
14 : BaseLoginDisplayHost(background_bounds) { 19 : BaseLoginDisplayHost(background_bounds),
20 login_window_(NULL),
21 login_view_(NULL) {
15 } 22 }
16 23
17 WebUILoginDisplayHost::~WebUILoginDisplayHost() { 24 WebUILoginDisplayHost::~WebUILoginDisplayHost() {
25 if (login_window_)
26 login_window_->Close();
18 } 27 }
19 28
20 // LoginDisplayHost implementation --------------------------------------------- 29 // LoginDisplayHost implementation ---------------------------------------------
21 30
22 LoginDisplay* WebUILoginDisplayHost::CreateLoginDisplay( 31 LoginDisplay* WebUILoginDisplayHost::CreateLoginDisplay(
23 LoginDisplay::Delegate* delegate) const { 32 LoginDisplay::Delegate* delegate) const {
24 WebUILoginDisplay* webui_login_display = WebUILoginDisplay::GetInstance(); 33 WebUILoginDisplay* webui_login_display = WebUILoginDisplay::GetInstance();
25 webui_login_display->set_delegate(delegate); 34 webui_login_display->set_delegate(delegate);
26 webui_login_display->set_background_bounds(background_bounds()); 35 webui_login_display->set_background_bounds(background_bounds());
27 return webui_login_display; 36 return webui_login_display;
(...skipping 14 matching lines...) Expand all
42 51
43 void WebUILoginDisplayHost::SetStatusAreaEnabled(bool enable) { 52 void WebUILoginDisplayHost::SetStatusAreaEnabled(bool enable) {
44 } 53 }
45 54
46 void WebUILoginDisplayHost::SetStatusAreaVisible(bool visible) { 55 void WebUILoginDisplayHost::SetStatusAreaVisible(bool visible) {
47 } 56 }
48 57
49 void WebUILoginDisplayHost::ShowBackground() { 58 void WebUILoginDisplayHost::ShowBackground() {
50 } 59 }
51 60
61 WizardController* WebUILoginDisplayHost::CreateWizardController() {
62 if (!login_window_) {
63 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
64 params.bounds = background_bounds();
65
66 login_window_ = new views::Widget;
67 login_window_->Init(params);
68
69 login_view_ = new WebUILoginView();
70
71 login_view_->Init(GURL("chrome://oobe"));
72 login_window_->SetContentsView(login_view_);
73 login_view_->UpdateWindowType();
74
75 login_window_->Show();
76 }
77
78 OobeDisplay* oobe_display = static_cast<OobeUI*>(login_view_->GetWebUI());
79 return new WizardController(this, oobe_display);
80 }
81
52 } // namespace chromeos 82 } // namespace chromeos
53
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698