Commit 3757670c authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Caret browsing should persist on startup.

We considered making caret browsing reset on startup, but the
final UX decision was that would just be more confusing.

With this patch, the caret browsing preference persists
like any normal preference - if it was enabled when you
exit Chrome, it will still be enabled the next time you
restart. The only exception is that if you pass the
--enable-caret-browsing switch it will be enabled by
default; this will keep things seamless for users who
have already been using the switch for the past year.

Bug: 1116659
Change-Id: I7653242fa2ee0a929855a3f9f77913a47f9eb9da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2360335Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799030}
parent 9d74890d
......@@ -1240,13 +1240,11 @@ void ProfileManager::DoFinalInit(ProfileInfo* profile_info,
signin_util::EnsurePrimaryAccountAllowedForProfile(profile);
#if !defined(OS_ANDROID)
// Caret browsing mode preference is not persisted between browser sessions,
// unless the command-line switch is also set - because otherwise it can be
// confusing if users don't realize that it was set.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
profile->GetPrefs()->SetBoolean(
prefs::kCaretBrowsingEnabled,
command_line->HasSwitch(switches::kEnableCaretBrowsing));
// The caret browsing command-line switch toggles caret browsing on
// initially, but the user can still toggle it from there.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableCaretBrowsing))
profile->GetPrefs()->SetBoolean(prefs::kCaretBrowsingEnabled, true);
#endif
}
......
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