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/chromeos/arc/arc_migration_guide_notification.h" |
| 6 |
| 7 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 8 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 9 #include "chrome/common/pref_names.h" |
| 10 #include "components/signin/core/account_id/account_id.h" |
| 11 #include "components/user_manager/known_user.h" |
| 12 |
| 13 namespace arc { |
| 14 |
| 15 void ShowArcMigrationSuccessNotificationIfNeeded(Profile* profile) { |
| 16 const AccountId account_id = |
| 17 multi_user_util::GetAccountIdFromProfile(profile); |
| 18 |
| 19 int pref_value = kFileSystemIncompatible; |
| 20 user_manager::known_user::GetIntegerPref( |
| 21 account_id, prefs::kArcCompatibleFilesystemChosen, &pref_value); |
| 22 |
| 23 // Show notification only when the pref value indicates the file system is |
| 24 // compatible, but not yet notified. |
| 25 if (pref_value != kFileSystemCompatible) |
| 26 return; |
| 27 |
| 28 // TODO(kinaba): The acutual notificaiton is added here in M59. |
| 29 // For M58, this function is deployed just for maintaining the pref value. |
| 30 |
| 31 // Mark as notified. |
| 32 user_manager::known_user::SetIntegerPref( |
| 33 account_id, prefs::kArcCompatibleFilesystemChosen, |
| 34 arc::kFileSystemCompatibleAndNotified); |
| 35 } |
| 36 |
| 37 } // namespace arc |
OLD | NEW |