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 3 // found in the LICENSE file. 4 5 #include "chrome/browser/chromeos/login/views_login_display_host.h" 6 7 #include "chrome/browser/chromeos/login/views_login_display.h" 8 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" 9 10 namespace chromeos { 11 12 // ViewsLoginDisplayHost ------------------------------------------------------- 13 ViewsLoginDisplayHost(const gfx::Rect & background_bounds)14ViewsLoginDisplayHost::ViewsLoginDisplayHost(const gfx::Rect& background_bounds) 15 : BaseLoginDisplayHost(background_bounds), 16 background_view_(NULL), 17 background_window_(NULL) { 18 } 19 ~ViewsLoginDisplayHost()20ViewsLoginDisplayHost::~ViewsLoginDisplayHost() { 21 if (background_window_) 22 background_window_->Close(); 23 } 24 25 // LoginDisplayHost implementation ----------------------------------------- 26 CreateLoginDisplay(LoginDisplay::Delegate * delegate) const27LoginDisplay* ViewsLoginDisplayHost::CreateLoginDisplay( 28 LoginDisplay::Delegate* delegate) const { 29 chromeos::WizardAccessibilityHelper::GetInstance()->Init(); 30 return new ViewsLoginDisplay(delegate, background_bounds()); 31 } 32 GetNativeWindow() const33gfx::NativeWindow ViewsLoginDisplayHost::GetNativeWindow() const { 34 if (background_view_) 35 return background_view_->GetNativeWindow(); 36 else 37 return NULL; 38 } 39 SetOobeProgress(BackgroundView::LoginStep step)40void ViewsLoginDisplayHost::SetOobeProgress(BackgroundView::LoginStep step) { 41 if (background_view_) 42 background_view_->SetOobeProgress(step); 43 } 44 SetOobeProgressBarVisible(bool visible)45void ViewsLoginDisplayHost::SetOobeProgressBarVisible(bool visible) { 46 if (background_view_) 47 background_view_->SetOobeProgressBarVisible(visible); 48 } 49 SetShutdownButtonEnabled(bool enable)50void ViewsLoginDisplayHost::SetShutdownButtonEnabled(bool enable) { 51 if (background_view_) 52 background_view_->EnableShutdownButton(enable); 53 } 54 SetStatusAreaEnabled(bool enable)55void ViewsLoginDisplayHost::SetStatusAreaEnabled(bool enable) { 56 if (background_view_) 57 background_view_->SetStatusAreaEnabled(enable); 58 } 59 SetStatusAreaVisible(bool visible)60void ViewsLoginDisplayHost::SetStatusAreaVisible(bool visible) { 61 if (background_view_) 62 background_view_->SetStatusAreaVisible(visible); 63 } 64 ShowBackground()65void ViewsLoginDisplayHost::ShowBackground() { 66 if (background_window_) { 67 background_window_->Show(); 68 return; 69 } 70 background_window_ = 71 BackgroundView::CreateWindowContainingView(background_bounds(), 72 GURL(), 73 &background_view_); 74 background_window_->Show(); 75 } 76 77 } // namespace chromeos 78 79