Commit ced26a6d authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

cros: Check if sync constent needs to be shown after browser restart

Sync constent screen was not being shown if the browser was restarted as part of
sign-in. If the browser did not need a restart sync constent showed up as
expected.

Bug: 890967
Change-Id: I3fe1b9232626334d3060eea5abb066519c503b6a
Reviewed-on: https://chromium-review.googlesource.com/c/1259884Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596400}
parent 1e53068d
......@@ -11,6 +11,7 @@
#include "chrome/browser/consent_auditor/consent_auditor_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/common/pref_names.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/consent_auditor/consent_auditor.h"
......@@ -34,6 +35,14 @@ browser_sync::ProfileSyncService* GetSyncService(Profile* profile) {
} // namespace
// static
void SyncConsentScreen::MaybeLaunchSyncConstentSettings(Profile* profile) {
if (profile->GetPrefs()->GetBoolean(prefs::kShowSyncSettingsOnSessionStart)) {
profile->GetPrefs()->ClearPref(prefs::kShowSyncSettingsOnSessionStart);
chrome::ShowSettingsSubPageForProfile(profile, "syncSetup");
}
}
SyncConsentScreen::SyncConsentScreen(BaseScreenDelegate* base_screen_delegate,
SyncConsentScreenView* view)
: BaseScreen(base_screen_delegate, OobeScreen::SCREEN_SYNC_CONSENT),
......
......@@ -53,6 +53,10 @@ class SyncConsentScreen : public BaseScreen,
DISALLOW_COPY_AND_ASSIGN(SyncConsentScreenTestDelegate);
};
// Launches the sync consent settings dialog if the user requested to review
// them after completing OOBE.
static void MaybeLaunchSyncConstentSettings(Profile* profile);
SyncConsentScreen(BaseScreenDelegate* base_screen_delegate,
SyncConsentScreenView* view);
~SyncConsentScreen() override;
......
......@@ -24,6 +24,7 @@
#include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
#include "chrome/browser/chromeos/login/lock/webui_screen_locker.h"
#include "chrome/browser/chromeos/login/login_wizard.h"
#include "chrome/browser/chromeos/login/screens/sync_consent_screen.h"
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/chromeos/policy/app_install_event_log_manager_wrapper.h"
......@@ -189,6 +190,7 @@ void StartUserSession(Profile* user_profile, const std::string& login_user_id) {
UserSessionManager::GetInstance()->CheckEolStatus(user_profile);
tpm_firmware_update::ShowNotificationIfNeeded(user_profile);
SyncConsentScreen::MaybeLaunchSyncConstentSettings(user_profile);
}
} // namespace
......
......@@ -57,6 +57,7 @@
#include "chrome/browser/chromeos/login/quick_unlock/pin_backend.h"
#include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h"
#include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h"
#include "chrome/browser/chromeos/login/screens/sync_consent_screen.h"
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h"
#include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h"
#include "chrome/browser/chromeos/login/signin/token_handle_fetcher.h"
......@@ -91,7 +92,6 @@
#include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
#include "chrome/browser/supervised_user/child_accounts/child_account_service_factory.h"
#include "chrome/browser/ui/app_list/app_list_client_impl.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_switches.h"
......@@ -2058,11 +2058,8 @@ void UserSessionManager::DoBrowserLaunchInternal(Profile* profile,
// completion of the file system migration necessary for ARC, when needed.
arc::ShowArcMigrationSuccessNotificationIfNeeded(profile);
if (should_launch_browser_ &&
profile->GetPrefs()->GetBoolean(prefs::kShowSyncSettingsOnSessionStart)) {
profile->GetPrefs()->ClearPref(prefs::kShowSyncSettingsOnSessionStart);
chrome::ShowSettingsSubPageForProfile(profile, "syncSetup");
}
if (should_launch_browser_)
SyncConsentScreen::MaybeLaunchSyncConstentSettings(profile);
}
void UserSessionManager::RespectLocalePreferenceWrapper(
......
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