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

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

Issue 2808353008: arc: kArcCompatibleFilesystemChosen pref to local state and integer. (Closed)
Patch Set: 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_util.cc
diff --git a/chrome/browser/chromeos/arc/arc_util.cc b/chrome/browser/chromeos/arc/arc_util.cc
index 7723792c34c6f22bc5eecadd693adb496c8f206d..3fbdd7aa9e3a0093fd5b6ce6928b1eb8ac29c2a5 100644
--- a/chrome/browser/chromeos/arc/arc_util.cc
+++ b/chrome/browser/chromeos/arc/arc_util.cc
@@ -19,6 +19,7 @@
#include "chrome/common/pref_names.h"
#include "components/arc/arc_util.h"
#include "components/prefs/pref_service.h"
+#include "components/user_manager/known_user.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
@@ -121,10 +122,20 @@ bool IsArcAllowedInAppListForProfile(const Profile* profile) {
}
bool IsArcCompatibleFileSystemUsedForProfile(const Profile* profile) {
- // chromeos::UserSessionManager::PrepareProfile does the actual file system
- // check and stores the result to prefs, so that it survives crash-restart.
+ const user_manager::User* user =
+ chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
+ if (!user)
+ return false;
hidehiko 2017/04/13 12:38:27 IIUC, this case is not expected even for testing?
xiyuan 2017/04/13 16:35:59 Think this should only happen in tests. GetUserByP
kinaba 2017/04/14 04:33:55 For instance, the sign-in profile does not have an
+
+ // chromeos::UserSessionManager does the actual file system check and stores
+ // the result to prefs, so that it survives crash-restart.
+ int filesystem_compatibility = kFileSystemIncompatible;
+ user_manager::known_user::GetIntegerPref(
+ user->GetAccountId(), prefs::kArcCompatibleFilesystemChosen,
+ &filesystem_compatibility);
+
const bool is_filesystem_compatible =
- profile->GetPrefs()->GetBoolean(prefs::kArcCompatibleFilesystemChosen);
+ filesystem_compatibility >= kFileSystemCompatible;
hidehiko 2017/04/13 12:38:27 Could you use "==" instead, just in case that a ne
kinaba 2017/04/14 04:33:55 changed to "!= Incompatible" (to align with the us
std::string arc_sdk_version;
const bool is_M = base::SysInfo::GetLsbReleaseValue(kLsbReleaseArcVersionKey,
&arc_sdk_version) &&

Powered by Google App Engine
This is Rietveld 408576698