Chromium Code Reviews| 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 const char kJsScreenPath[] = "login.EncryptionMigrationScreen"; | |
|
xiyuan
2017/03/28 17:15:04
nit: const -> constexpr
fukino
2017/03/29 01:03:57
Done.
| |
| 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()) { | |
|
xiyuan
2017/03/28 17:15:04
nit: check !delegate_ to make it consistent with w
fukino
2017/03/29 01:03:57
Done.
| |
| 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 } // chromeos | |
| OLD | NEW |