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

Unified Diff: chrome/browser/chromeos/arc/arc_migration_guide_notification.cc

Issue 2850123002: M58: arc: Set migration success notification pref. (Closed)
Patch Set: Fix some comment for M58 Created 3 years, 8 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/chromeos/arc/arc_migration_guide_notification.cc
diff --git a/chrome/browser/chromeos/arc/arc_migration_guide_notification.cc b/chrome/browser/chromeos/arc/arc_migration_guide_notification.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2e222ee852b1193d0ec1e0c2a5fe6685e2db8ee1
--- /dev/null
+++ b/chrome/browser/chromeos/arc/arc_migration_guide_notification.cc
@@ -0,0 +1,37 @@
+// 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/chromeos/arc/arc_migration_guide_notification.h"
+
+#include "chrome/browser/chromeos/arc/arc_util.h"
+#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
+#include "chrome/common/pref_names.h"
+#include "components/signin/core/account_id/account_id.h"
+#include "components/user_manager/known_user.h"
+
+namespace arc {
+
+void ShowArcMigrationSuccessNotificationIfNeeded(Profile* profile) {
+ const AccountId account_id =
+ multi_user_util::GetAccountIdFromProfile(profile);
+
+ int pref_value = kFileSystemIncompatible;
+ user_manager::known_user::GetIntegerPref(
+ account_id, prefs::kArcCompatibleFilesystemChosen, &pref_value);
+
+ // Show notification only when the pref value indicates the file system is
+ // compatible, but not yet notified.
+ if (pref_value != kFileSystemCompatible)
+ return;
+
+ // TODO(kinaba): The acutual notificaiton is added here in M59.
+ // For M58, this function is deployed just for maintaining the pref value.
+
+ // Mark as notified.
+ user_manager::known_user::SetIntegerPref(
+ account_id, prefs::kArcCompatibleFilesystemChosen,
+ arc::kFileSystemCompatibleAndNotified);
+}
+
+} // namespace arc
« no previous file with comments | « chrome/browser/chromeos/arc/arc_migration_guide_notification.h ('k') | chrome/browser/chromeos/arc/arc_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698