Commit b2af9e74 authored by dzhioev's avatar dzhioev Committed by Commit bot

Enabled first-run tutorial for ephemeral users.

First-run tutorial is shown for regular ephemeral users, but only if we 100%
sure that this user has never seen the tutorial yet.

BUG=333264
TEST=manually

Review URL: https://codereview.chromium.org/1141163003

Cr-Commit-Position: refs/heads/master@{#330186}
parent f7c815cc
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "chrome/browser/chromeos/first_run/first_run_controller.h" #include "chrome/browser/chromeos/first_run/first_run_controller.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/extensions/app_launch_params.h" #include "chrome/browser/ui/extensions/app_launch_params.h"
#include "chrome/browser/ui/extensions/application_launch.h" #include "chrome/browser/ui/extensions/application_launch.h"
...@@ -76,8 +77,13 @@ class DialogLauncher : public content::NotificationObserver { ...@@ -76,8 +77,13 @@ class DialogLauncher : public content::NotificationObserver {
bool first_run_forced = command_line->HasSwitch(switches::kForceFirstRunUI); bool first_run_forced = command_line->HasSwitch(switches::kForceFirstRunUI);
bool first_run_seen = bool first_run_seen =
profile_->GetPrefs()->GetBoolean(prefs::kFirstRunTutorialShown); profile_->GetPrefs()->GetBoolean(prefs::kFirstRunTutorialShown);
bool is_pref_synced =
PrefServiceSyncable::FromProfile(profile_)->IsPrioritySyncing();
bool is_user_ephemeral = user_manager::UserManager::Get()
->IsCurrentUserNonCryptohomeDataEphemeral();
if (!launched_in_telemetry && if (!launched_in_telemetry &&
((is_user_new && !first_run_seen && !launched_in_test) || ((is_user_new && !first_run_seen &&
(is_pref_synced || !is_user_ephemeral) && !launched_in_test) ||
first_run_forced)) { first_run_forced)) {
LaunchDialogForProfile(profile_); LaunchDialogForProfile(profile_);
} }
......
...@@ -109,6 +109,11 @@ void UserImageScreen::OnCameraPresenceCheckDone(bool is_camera_present) { ...@@ -109,6 +109,11 @@ void UserImageScreen::OnCameraPresenceCheckDone(bool is_camera_present) {
} }
void UserImageScreen::HideCurtain() { void UserImageScreen::HideCurtain() {
// Skip user image selection for ephemeral users.
if (user_manager::UserManager::Get()->IsUserNonCryptohomeDataEphemeral(
GetUser()->GetUserID())) {
ExitScreen();
}
if (view_) if (view_)
view_->HideCurtain(); view_->HideCurtain();
} }
......
...@@ -1121,10 +1121,8 @@ void UserSessionManager::InitializeStartUrls() const { ...@@ -1121,10 +1121,8 @@ void UserSessionManager::InitializeStartUrls() const {
user_manager::UserManager* user_manager = user_manager::UserManager::Get(); user_manager::UserManager* user_manager = user_manager::UserManager::Get();
bool can_show_getstarted_guide = bool can_show_getstarted_guide = user_manager->GetActiveUser()->GetType() ==
user_manager->GetActiveUser()->GetType() == user_manager::USER_TYPE_REGULAR;
user_manager::USER_TYPE_REGULAR &&
!user_manager->IsCurrentUserNonCryptohomeDataEphemeral();
// Skip the default first-run behavior for public accounts. // Skip the default first-run behavior for public accounts.
if (!user_manager->IsLoggedInAsPublicAccount()) { if (!user_manager->IsLoggedInAsPublicAccount()) {
......
...@@ -401,9 +401,12 @@ void WizardController::ShowUpdateScreen() { ...@@ -401,9 +401,12 @@ void WizardController::ShowUpdateScreen() {
void WizardController::ShowUserImageScreen() { void WizardController::ShowUserImageScreen() {
const user_manager::UserManager* user_manager = const user_manager::UserManager* user_manager =
user_manager::UserManager::Get(); user_manager::UserManager::Get();
// Skip user image selection for public sessions and ephemeral logins. // Skip user image selection for public sessions and ephemeral non-regual user
// logins.
if (user_manager->IsLoggedInAsPublicAccount() || if (user_manager->IsLoggedInAsPublicAccount() ||
user_manager->IsCurrentUserNonCryptohomeDataEphemeral()) { (user_manager->IsCurrentUserNonCryptohomeDataEphemeral() &&
user_manager->GetLoggedInUser()->GetType() !=
user_manager::USER_TYPE_REGULAR)) {
OnUserImageSkipped(); OnUserImageSkipped();
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment