| 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 "views_enterprise_enrollment_screen_actor.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 | |
| 9 namespace chromeos { | |
| 10 | |
| 11 // ViewsEnterpriseEnrollmentScreenActor, public -------------------------------- | |
| 12 | |
| 13 ViewsEnterpriseEnrollmentScreenActor::ViewsEnterpriseEnrollmentScreenActor( | |
| 14 ViewScreenDelegate* delegate) | |
| 15 : ViewScreen<EnterpriseEnrollmentView> (delegate), | |
| 16 controller_(NULL) { | |
| 17 } | |
| 18 | |
| 19 ViewsEnterpriseEnrollmentScreenActor::~ViewsEnterpriseEnrollmentScreenActor() { | |
| 20 NotifyObservers(false); | |
| 21 } | |
| 22 | |
| 23 // ViewsEnterpriseEnrollmentScreenActor, ViewScreen implementation ------------- | |
| 24 | |
| 25 EnterpriseEnrollmentView* ViewsEnterpriseEnrollmentScreenActor::AllocateView() { | |
| 26 return new EnterpriseEnrollmentView(controller_); | |
| 27 } | |
| 28 | |
| 29 // ViewsEnterpriseEnrollmentScreenActor, | |
| 30 // EnterpriseEnrollmentScreenActor implementation -------------------------- | |
| 31 | |
| 32 void ViewsEnterpriseEnrollmentScreenActor::SetController( | |
| 33 Controller* controller) { | |
| 34 controller_ = controller; | |
| 35 } | |
| 36 | |
| 37 void ViewsEnterpriseEnrollmentScreenActor::SetEditableUser(bool editable) { | |
| 38 GetUIActor()->SetEditableUser(editable); | |
| 39 } | |
| 40 | |
| 41 void ViewsEnterpriseEnrollmentScreenActor::PrepareToShow() { | |
| 42 ViewScreen<EnterpriseEnrollmentView>::PrepareToShow(); | |
| 43 } | |
| 44 | |
| 45 void ViewsEnterpriseEnrollmentScreenActor::Show() { | |
| 46 ViewScreen<EnterpriseEnrollmentView>::Show(); | |
| 47 // Make the focus go initially to the DOMView, so that the email input field | |
| 48 // receives the focus. | |
| 49 view()->RequestFocus(); | |
| 50 } | |
| 51 | |
| 52 void ViewsEnterpriseEnrollmentScreenActor::Hide() { | |
| 53 ViewScreen<EnterpriseEnrollmentView>::Hide(); | |
| 54 } | |
| 55 | |
| 56 void ViewsEnterpriseEnrollmentScreenActor::ShowConfirmationScreen() { | |
| 57 GetUIActor()->ShowConfirmationScreen(); | |
| 58 NotifyObservers(true); | |
| 59 } | |
| 60 | |
| 61 void ViewsEnterpriseEnrollmentScreenActor::ShowAuthError( | |
| 62 const GoogleServiceAuthError & error) { | |
| 63 GetUIActor()->ShowAuthError(error); | |
| 64 NotifyObservers(false); | |
| 65 } | |
| 66 | |
| 67 void ViewsEnterpriseEnrollmentScreenActor::ShowAccountError() { | |
| 68 GetUIActor()->ShowAccountError(); | |
| 69 NotifyObservers(false); | |
| 70 } | |
| 71 | |
| 72 void ViewsEnterpriseEnrollmentScreenActor::ShowSerialNumberError() { | |
| 73 GetUIActor()->ShowSerialNumberError(); | |
| 74 NotifyObservers(false); | |
| 75 } | |
| 76 | |
| 77 void ViewsEnterpriseEnrollmentScreenActor::ShowFatalAuthError() { | |
| 78 GetUIActor()->ShowFatalAuthError(); | |
| 79 NotifyObservers(false); | |
| 80 } | |
| 81 | |
| 82 void ViewsEnterpriseEnrollmentScreenActor::ShowFatalEnrollmentError() { | |
| 83 GetUIActor()->ShowFatalEnrollmentError(); | |
| 84 NotifyObservers(false); | |
| 85 } | |
| 86 | |
| 87 void ViewsEnterpriseEnrollmentScreenActor::ShowNetworkEnrollmentError() { | |
| 88 GetUIActor()->ShowNetworkEnrollmentError(); | |
| 89 NotifyObservers(false); | |
| 90 } | |
| 91 | |
| 92 // ViewsEnterpriseEnrollmentScreenActor, public -------------------------------- | |
| 93 | |
| 94 EnterpriseEnrollmentScreenActor* | |
| 95 ViewsEnterpriseEnrollmentScreenActor::GetUIActor() { | |
| 96 DCHECK(view()); | |
| 97 return view()->GetActor(); | |
| 98 } | |
| 99 | |
| 100 } // namespace chromeos | |
| OLD | NEW |