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

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

Issue 7382001: [ChromeOS] WebUI OOBE/Login refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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/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" 10 #include "chrome/browser/chromeos/login/touch_login_view.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 void WebUILoginDisplayHost::StartWizard(const std::string& first_screen_name, 75 void WebUILoginDisplayHost::StartWizard(const std::string& first_screen_name,
76 const GURL& start_url) { 76 const GURL& start_url) {
77 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAllowWebUIOobe)) 77 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAllowWebUIOobe))
78 LoadURL(GURL(kOobeURL)); 78 LoadURL(GURL(kOobeURL));
79 BaseLoginDisplayHost::StartWizard(first_screen_name, start_url); 79 BaseLoginDisplayHost::StartWizard(first_screen_name, start_url);
80 } 80 }
81 81
82 void WebUILoginDisplayHost::StartSignInScreen() { 82 void WebUILoginDisplayHost::StartSignInScreen() {
83 if (!login_window_)
84 // TODO(fsamuel): Use the OOBE once it's touch-friendly. 83 // TODO(fsamuel): Use the OOBE once it's touch-friendly.
Nikita (slow) 2011/07/15 07:11:02 We should behave the same and show OOBE WebUI on t
Fady Samuel 2011/07/15 15:06:07 That's fair. A couple of days ago, we were getting
xiyuan 2011/07/15 18:26:23 Okay. Per discussion, I'll use kOobeUURL for now.
85 #if defined(TOUCH_UI) 84 #if defined(TOUCH_UI)
86 LoadURL(GURL(kLoginURL)); 85 LoadURL(GURL(kLoginURL));
87 #else
88 LoadURL(GURL(kOobeURL));
89 #endif 86 #endif
90 87
91 BaseLoginDisplayHost::StartSignInScreen(); 88 BaseLoginDisplayHost::StartSignInScreen();
92 89
90 #if !defined(TOUCH_UI)
91 // OobeUI is only available with kOobeURL.
93 OobeUI* oobe_ui = static_cast<OobeUI*>(login_view_->GetWebUI()); 92 OobeUI* oobe_ui = static_cast<OobeUI*>(login_view_->GetWebUI());
94 oobe_ui->ShowSigninScreen(); 93 oobe_ui->ShowSigninScreen();
94 #endif
95 } 95 }
96 96
97 void WebUILoginDisplayHost::LoadURL(const GURL& url) { 97 void WebUILoginDisplayHost::LoadURL(const GURL& url) {
98 if (!login_window_) { 98 if (!login_window_) {
99 views::Widget::InitParams params( 99 views::Widget::InitParams params(
100 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 100 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
101 params.bounds = background_bounds(); 101 params.bounds = background_bounds();
102 102
103 login_window_ = new views::Widget; 103 login_window_ = new views::Widget;
104 login_window_->Init(params); 104 login_window_->Init(params);
(...skipping 14 matching lines...) Expand all
119 login_view_->LoadURL(url); 119 login_view_->LoadURL(url);
120 } 120 }
121 121
122 WizardController* WebUILoginDisplayHost::CreateWizardController() { 122 WizardController* WebUILoginDisplayHost::CreateWizardController() {
123 // TODO(altimofeev): ensure that WebUI is ready. 123 // TODO(altimofeev): ensure that WebUI is ready.
124 OobeDisplay* oobe_display = static_cast<OobeUI*>(login_view_->GetWebUI()); 124 OobeDisplay* oobe_display = static_cast<OobeUI*>(login_view_->GetWebUI());
125 return new WizardController(this, oobe_display); 125 return new WizardController(this, oobe_display);
126 } 126 }
127 127
128 } // namespace chromeos 128 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698