OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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/screens/enable_debugging_screen.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
| 9 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 10 |
| 11 namespace chromeos { |
| 12 |
| 13 EnableDebuggingScreen::EnableDebuggingScreen( |
| 14 BaseScreenDelegate* delegate, |
| 15 EnableDebuggingScreenActor* actor) |
| 16 : BaseScreen(delegate), actor_(actor) { |
| 17 DCHECK(actor_); |
| 18 if (actor_) |
| 19 actor_->SetDelegate(this); |
| 20 } |
| 21 |
| 22 EnableDebuggingScreen::~EnableDebuggingScreen() { |
| 23 if (actor_) |
| 24 actor_->SetDelegate(NULL); |
| 25 } |
| 26 |
| 27 void EnableDebuggingScreen::PrepareToShow() { |
| 28 if (actor_) |
| 29 actor_->PrepareToShow(); |
| 30 } |
| 31 |
| 32 void EnableDebuggingScreen::Show() { |
| 33 if (actor_) |
| 34 actor_->Show(); |
| 35 } |
| 36 |
| 37 void EnableDebuggingScreen::Hide() { |
| 38 if (actor_) |
| 39 actor_->Hide(); |
| 40 } |
| 41 |
| 42 std::string EnableDebuggingScreen::GetName() const { |
| 43 return WizardController::kEnableDebuggingScreenName; |
| 44 } |
| 45 |
| 46 void EnableDebuggingScreen::OnExit(bool success) { |
| 47 Finish(success ? BaseScreenDelegate::ENABLE_DEBUGGING_FINISHED : |
| 48 BaseScreenDelegate::ENABLE_DEBUGGING_CANCELED); |
| 49 } |
| 50 |
| 51 void EnableDebuggingScreen::OnActorDestroyed( |
| 52 EnableDebuggingScreenActor* actor) { |
| 53 if (actor_ == actor) |
| 54 actor_ = NULL; |
| 55 } |
| 56 |
| 57 } // namespace chromeos |
OLD | NEW |