| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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/ui/webui/chromeos/login/encryption_migration_screen_han
dler.h" |
| 6 |
| 7 namespace { |
| 8 |
| 9 constexpr char kJsScreenPath[] = "login.EncryptionMigrationScreen"; |
| 10 |
| 11 } // namespace |
| 12 |
| 13 namespace chromeos { |
| 14 |
| 15 EncryptionMigrationScreenHandler::EncryptionMigrationScreenHandler() |
| 16 : BaseScreenHandler(kScreenId) { |
| 17 set_call_js_prefix(kJsScreenPath); |
| 18 } |
| 19 |
| 20 EncryptionMigrationScreenHandler::~EncryptionMigrationScreenHandler() { |
| 21 if (delegate_) |
| 22 delegate_->OnViewDestroyed(this); |
| 23 } |
| 24 |
| 25 void EncryptionMigrationScreenHandler::Show() { |
| 26 if (!page_is_ready() || !delegate_) { |
| 27 show_on_init_ = true; |
| 28 return; |
| 29 } |
| 30 ShowScreen(kScreenId); |
| 31 } |
| 32 |
| 33 void EncryptionMigrationScreenHandler::Hide() { |
| 34 show_on_init_ = false; |
| 35 } |
| 36 |
| 37 void EncryptionMigrationScreenHandler::SetDelegate(Delegate* delegate) { |
| 38 delegate_ = delegate; |
| 39 if (page_is_ready()) |
| 40 Initialize(); |
| 41 } |
| 42 |
| 43 void EncryptionMigrationScreenHandler::DeclareLocalizedValues( |
| 44 ::login::LocalizedValuesBuilder* builder) {} |
| 45 |
| 46 void EncryptionMigrationScreenHandler::Initialize() { |
| 47 if (!page_is_ready() || !delegate_) |
| 48 return; |
| 49 |
| 50 if (show_on_init_) { |
| 51 Show(); |
| 52 show_on_init_ = false; |
| 53 } |
| 54 } |
| 55 |
| 56 } // namespace chromeos |
| OLD | NEW |