| OLD | NEW |
| (Empty) |
| 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/views_oobe_display.h" | |
| 9 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | |
| 10 #include "chrome/browser/chromeos/login/wizard_controller.h" | |
| 11 | |
| 12 | |
| 13 namespace chromeos { | |
| 14 | |
| 15 // ViewsLoginDisplayHost ------------------------------------------------------- | |
| 16 | |
| 17 ViewsLoginDisplayHost::ViewsLoginDisplayHost(const gfx::Rect& background_bounds) | |
| 18 : BaseLoginDisplayHost(background_bounds), | |
| 19 background_view_(NULL), | |
| 20 background_window_(NULL) { | |
| 21 } | |
| 22 | |
| 23 ViewsLoginDisplayHost::~ViewsLoginDisplayHost() { | |
| 24 if (background_window_) | |
| 25 background_window_->Close(); | |
| 26 } | |
| 27 | |
| 28 // LoginDisplayHost implementation ----------------------------------------- | |
| 29 | |
| 30 LoginDisplay* ViewsLoginDisplayHost::CreateLoginDisplay( | |
| 31 LoginDisplay::Delegate* delegate) { | |
| 32 chromeos::WizardAccessibilityHelper::GetInstance()->Init(); | |
| 33 return new ViewsLoginDisplay(delegate, background_bounds()); | |
| 34 } | |
| 35 | |
| 36 gfx::NativeWindow ViewsLoginDisplayHost::GetNativeWindow() const { | |
| 37 if (background_view_) | |
| 38 return background_view_->GetNativeWindow(); | |
| 39 else | |
| 40 return NULL; | |
| 41 } | |
| 42 | |
| 43 void ViewsLoginDisplayHost::SetOobeProgress(BackgroundView::LoginStep step) { | |
| 44 if (background_view_) | |
| 45 background_view_->SetOobeProgress(step); | |
| 46 } | |
| 47 | |
| 48 void ViewsLoginDisplayHost::SetOobeProgressBarVisible(bool visible) { | |
| 49 if (background_view_) | |
| 50 background_view_->SetOobeProgressBarVisible(visible); | |
| 51 } | |
| 52 | |
| 53 void ViewsLoginDisplayHost::SetShutdownButtonEnabled(bool enable) { | |
| 54 if (background_view_) | |
| 55 background_view_->EnableShutdownButton(enable); | |
| 56 } | |
| 57 | |
| 58 void ViewsLoginDisplayHost::SetStatusAreaEnabled(bool enable) { | |
| 59 if (background_view_) | |
| 60 background_view_->SetStatusAreaEnabled(enable); | |
| 61 } | |
| 62 | |
| 63 void ViewsLoginDisplayHost::SetStatusAreaVisible(bool visible) { | |
| 64 if (background_view_) | |
| 65 background_view_->SetStatusAreaVisible(visible); | |
| 66 } | |
| 67 | |
| 68 void ViewsLoginDisplayHost::ShowBackground() { | |
| 69 if (background_window_) { | |
| 70 background_window_->Show(); | |
| 71 return; | |
| 72 } | |
| 73 background_window_ = | |
| 74 BackgroundView::CreateWindowContainingView(background_bounds(), | |
| 75 GURL(), | |
| 76 &background_view_); | |
| 77 background_window_->Show(); | |
| 78 } | |
| 79 | |
| 80 void ViewsLoginDisplayHost::StartSignInScreen() { | |
| 81 oobe_display_.reset(); | |
| 82 BaseLoginDisplayHost::StartSignInScreen(); | |
| 83 } | |
| 84 | |
| 85 WizardController* ViewsLoginDisplayHost::CreateWizardController() { | |
| 86 oobe_display_.reset(new ViewsOobeDisplay(background_bounds())); | |
| 87 WizardController* wizard_controller = | |
| 88 new WizardController(this, oobe_display_.get()); | |
| 89 oobe_display_->SetScreenObserver(wizard_controller); | |
| 90 return wizard_controller; | |
| 91 } | |
| 92 | |
| 93 } // namespace chromeos | |
| OLD | NEW |