Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1741)

Unified Diff: chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc

Issue 2779933002: Add a screen to migrate filesystem encryption from eCryptfs to ext4 crypto. (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..72fb1538b0f82c99fd62be247bf886c1549c7b05
--- /dev/null
+++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
@@ -0,0 +1,56 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h"
+
+namespace {
+
+const char kJsScreenPath[] = "login.EncryptionMigrationScreen";
xiyuan 2017/03/28 17:15:04 nit: const -> constexpr
fukino 2017/03/29 01:03:57 Done.
+
+} // namespace
+
+namespace chromeos {
+
+EncryptionMigrationScreenHandler::EncryptionMigrationScreenHandler()
+ : BaseScreenHandler(kScreenId) {
+ set_call_js_prefix(kJsScreenPath);
+}
+
+EncryptionMigrationScreenHandler::~EncryptionMigrationScreenHandler() {
+ if (delegate_)
+ delegate_->OnViewDestroyed(this);
+}
+
+void EncryptionMigrationScreenHandler::Show() {
+ 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.
+ show_on_init_ = true;
+ return;
+ }
+ ShowScreen(kScreenId);
+}
+
+void EncryptionMigrationScreenHandler::Hide() {
+ show_on_init_ = false;
+}
+
+void EncryptionMigrationScreenHandler::SetDelegate(Delegate* delegate) {
+ delegate_ = delegate;
+ if (page_is_ready())
+ Initialize();
+}
+
+void EncryptionMigrationScreenHandler::DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) {}
+
+void EncryptionMigrationScreenHandler::Initialize() {
+ if (!page_is_ready() || !delegate_)
+ return;
+
+ if (show_on_init_) {
+ Show();
+ show_on_init_ = false;
+ }
+}
+
+} // chromeos

Powered by Google App Engine
This is Rietveld 408576698