| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/managed/locally_managed_user_creation_sc
reen.h" | 5 #include "chrome/browser/chromeos/login/managed/locally_managed_user_creation_sc
reen.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 last_page_(kNameOfIntroScreen), | 90 last_page_(kNameOfIntroScreen), |
| 91 image_decoder_(NULL), | 91 image_decoder_(NULL), |
| 92 apply_photo_after_decoding_(false), | 92 apply_photo_after_decoding_(false), |
| 93 selected_image_(0) { | 93 selected_image_(0) { |
| 94 DCHECK(actor_); | 94 DCHECK(actor_); |
| 95 if (actor_) | 95 if (actor_) |
| 96 actor_->SetDelegate(this); | 96 actor_->SetDelegate(this); |
| 97 } | 97 } |
| 98 | 98 |
| 99 LocallyManagedUserCreationScreen::~LocallyManagedUserCreationScreen() { | 99 LocallyManagedUserCreationScreen::~LocallyManagedUserCreationScreen() { |
| 100 CameraPresenceNotifier::GetInstance()->RemoveObserver(this); |
| 100 if (actor_) | 101 if (actor_) |
| 101 actor_->SetDelegate(NULL); | 102 actor_->SetDelegate(NULL); |
| 102 if (image_decoder_.get()) | 103 if (image_decoder_.get()) |
| 103 image_decoder_->set_delegate(NULL); | 104 image_decoder_->set_delegate(NULL); |
| 104 NetworkPortalDetector::Get()->RemoveObserver(this); | 105 NetworkPortalDetector::Get()->RemoveObserver(this); |
| 105 } | 106 } |
| 106 | 107 |
| 107 void LocallyManagedUserCreationScreen::PrepareToShow() { | 108 void LocallyManagedUserCreationScreen::PrepareToShow() { |
| 108 if (actor_) | 109 if (actor_) |
| 109 actor_->PrepareToShow(); | 110 actor_->PrepareToShow(); |
| 110 } | 111 } |
| 111 | 112 |
| 112 void LocallyManagedUserCreationScreen::Show() { | 113 void LocallyManagedUserCreationScreen::Show() { |
| 114 CameraPresenceNotifier::GetInstance()->AddObserver(this); |
| 113 if (actor_) { | 115 if (actor_) { |
| 114 actor_->Show(); | 116 actor_->Show(); |
| 115 // TODO(antrim) : temorary hack (until upcoming hackaton). Should be | 117 // TODO(antrim) : temorary hack (until upcoming hackaton). Should be |
| 116 // removed once we have screens reworked. | 118 // removed once we have screens reworked. |
| 117 if (on_error_screen_) | 119 if (on_error_screen_) |
| 118 actor_->ShowPage(last_page_); | 120 actor_->ShowPage(last_page_); |
| 119 else | 121 else |
| 120 actor_->ShowIntroPage(); | 122 actor_->ShowIntroPage(); |
| 121 } | 123 } |
| 122 | 124 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 l10n_util::GetStringUTF16( | 157 l10n_util::GetStringUTF16( |
| 156 IDS_CREATE_LOCALLY_MANAGED_USER_MANAGER_INCONSISTENT_STATE_BUTTON)); | 158 IDS_CREATE_LOCALLY_MANAGED_USER_MANAGER_INCONSISTENT_STATE_BUTTON)); |
| 157 } | 159 } |
| 158 | 160 |
| 159 void LocallyManagedUserCreationScreen::ShowInitialScreen() { | 161 void LocallyManagedUserCreationScreen::ShowInitialScreen() { |
| 160 if (actor_) | 162 if (actor_) |
| 161 actor_->ShowIntroPage(); | 163 actor_->ShowIntroPage(); |
| 162 } | 164 } |
| 163 | 165 |
| 164 void LocallyManagedUserCreationScreen::Hide() { | 166 void LocallyManagedUserCreationScreen::Hide() { |
| 167 CameraPresenceNotifier::GetInstance()->RemoveObserver(this); |
| 165 if (actor_) | 168 if (actor_) |
| 166 actor_->Hide(); | 169 actor_->Hide(); |
| 167 if (!on_error_screen_) | 170 if (!on_error_screen_) |
| 168 NetworkPortalDetector::Get()->RemoveObserver(this); | 171 NetworkPortalDetector::Get()->RemoveObserver(this); |
| 169 } | 172 } |
| 170 | 173 |
| 171 std::string LocallyManagedUserCreationScreen::GetName() const { | 174 std::string LocallyManagedUserCreationScreen::GetName() const { |
| 172 return WizardController::kLocallyManagedUserCreationScreenName; | 175 return WizardController::kLocallyManagedUserCreationScreenName; |
| 173 } | 176 } |
| 174 | 177 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 selected_image_ = User::kExternalImageIndex; | 557 selected_image_ = User::kExternalImageIndex; |
| 555 } else { | 558 } else { |
| 556 NOTREACHED() << "Unexpected image type: " << image_type; | 559 NOTREACHED() << "Unexpected image type: " << image_type; |
| 557 } | 560 } |
| 558 } | 561 } |
| 559 | 562 |
| 560 void LocallyManagedUserCreationScreen::OnImageAccepted() { | 563 void LocallyManagedUserCreationScreen::OnImageAccepted() { |
| 561 } | 564 } |
| 562 | 565 |
| 563 } // namespace chromeos | 566 } // namespace chromeos |
| OLD | NEW |