[cros] WebUI: use correct visibility for StatusArea on boot.

Now that StatusArea creation is deferred till page is loaded have to save visibility state that is changed via WebUILoginDisplayHost.

BUG=chromium-os:19587
TEST=Manual.


Review URL: http://codereview.chromium.org/7748041

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98448 0039d316-1c4b-4281-b951-d872f2087c98
parent 7ae1fa6a
...@@ -46,7 +46,8 @@ WebUILoginView::WebUILoginView() ...@@ -46,7 +46,8 @@ WebUILoginView::WebUILoginView()
profile_(NULL), profile_(NULL),
webui_login_(NULL), webui_login_(NULL),
status_window_(NULL), status_window_(NULL),
host_window_frozen_(false) { host_window_frozen_(false),
status_area_visibility_on_init_(true) {
#if defined(TOUCH_UI) #if defined(TOUCH_UI)
// Make sure the singleton KeyboardManager object is created. // Make sure the singleton KeyboardManager object is created.
KeyboardManager::GetInstance(); KeyboardManager::GetInstance();
...@@ -137,6 +138,8 @@ void WebUILoginView::SetStatusAreaEnabled(bool enable) { ...@@ -137,6 +138,8 @@ void WebUILoginView::SetStatusAreaEnabled(bool enable) {
void WebUILoginView::SetStatusAreaVisible(bool visible) { void WebUILoginView::SetStatusAreaVisible(bool visible) {
if (status_area_) if (status_area_)
status_area_->SetVisible(visible); status_area_->SetVisible(visible);
else
status_area_visibility_on_init_ = visible;
} }
// WebUILoginView protected: --------------------------------------------------- // WebUILoginView protected: ---------------------------------------------------
...@@ -221,6 +224,7 @@ void WebUILoginView::InitStatusArea() { ...@@ -221,6 +224,7 @@ void WebUILoginView::InitStatusArea() {
DCHECK(status_window_ == NULL); DCHECK(status_window_ == NULL);
status_area_ = new StatusAreaView(this); status_area_ = new StatusAreaView(this);
status_area_->Init(); status_area_->Init();
status_area_->SetVisible(status_area_visibility_on_init_);
views::Widget* login_window = WebUILoginDisplay::GetLoginWindow(); views::Widget* login_window = WebUILoginDisplay::GetLoginWindow();
gfx::Size size = status_area_->GetPreferredSize(); gfx::Size size = status_area_->GetPreferredSize();
......
...@@ -135,6 +135,9 @@ class WebUILoginView : public views::View, ...@@ -135,6 +135,9 @@ class WebUILoginView : public views::View,
// Whether the host window is frozen. // Whether the host window is frozen.
bool host_window_frozen_; bool host_window_frozen_;
// Caches StatusArea visibility setting before it has been initialized.
bool status_area_visibility_on_init_;
DISALLOW_COPY_AND_ASSIGN(WebUILoginView); DISALLOW_COPY_AND_ASSIGN(WebUILoginView);
}; };
......
...@@ -238,12 +238,14 @@ chromeos::EnterpriseEnrollmentScreen* ...@@ -238,12 +238,14 @@ chromeos::EnterpriseEnrollmentScreen*
} }
void WizardController::ShowNetworkScreen() { void WizardController::ShowNetworkScreen() {
VLOG(1) << "Showing network screen.";
SetStatusAreaVisible(false); SetStatusAreaVisible(false);
SetCurrentScreen(GetNetworkScreen()); SetCurrentScreen(GetNetworkScreen());
host_->SetOobeProgress(chromeos::BackgroundView::SELECT_NETWORK); host_->SetOobeProgress(chromeos::BackgroundView::SELECT_NETWORK);
} }
void WizardController::ShowLoginScreen() { void WizardController::ShowLoginScreen() {
VLOG(1) << "Showing login screen.";
SetStatusAreaVisible(true); SetStatusAreaVisible(true);
host_->SetOobeProgress(chromeos::BackgroundView::SIGNIN); host_->SetOobeProgress(chromeos::BackgroundView::SIGNIN);
host_->StartSignInScreen(); host_->StartSignInScreen();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment