Chromium Code Reviews
DescriptionMerge 3 different ways of obtaining first run state (BrowserMain's |is_first_run|/|do_first_run_tasks_| and first_run::IsChromeFirstRun()) into a single one.
We have switches to force the browser in/out of thinking it's first run (--force-first-run and --no-first-run). Yet first_run::IsChromeFirstRun() didn't use those and thus some code entry points weren't respecting --force-first-run correctly.
We also had |is_first_run| and |do_first_run_tasks_| in chrome_browser_main.cc... I forget why I thought that was a good idea originally, but I no longer do..! Perhaps some things changed since..?
There are basically 3 first run state that matter:
1) It is first run => do the first run things everywhere (can be forced by --force-first-run)
2) It's not first run (neither forced, nor is first run sentinel present) => Don't do first run things.
3) --no-first-run => Just like (2), but we also create the first run sentinel to prevent any subsequent launches from being a natural first run.
This logic is now all coded up in a single place in first_run::IsChromeFirstRun().
Other changes (highlighted inline in patch set 1):
1) Some first run things used to be skipped on CHROME_OS based on a hidden ifdef; moved that ifdef up where it makes sense in chrome_browser_main.cc
2) Running first run in App mode or App Launcher mode would prevent a bunch of silent things from happening, based on an if which was originally there to prevent the import UI I believe (which is now silent...), reverted that trend: running App mode now only prevents adding first run tabs.
Also found issue 264694 while working on this CL, addressed with further cleanup in https://codereview.chromium.org/20743002/.
BUG=234647, 264694
TEST=
A) Launch chrome.exe with no First Run sentinel, make sure first run happens once (relaunch and it shouldn't happen twice).
B) Launch chrome.exe with First Run sentinel, but with --force-first-run, make sure first run happens anyways.
C) Launch chrome.exe with no First Run sentinel, but with --no-first-run, make sure first run doesn't happen (and doesn't happen in subsequent relaunches either without the flag).
R=cpu@chromium.org, jam@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=214514
Patch Set 1 : #
Total comments: 14
Patch Set 2 : Remove is_first_run_ ChromeBrowserMain state entirely. #Patch Set 3 : Do not change StartupBrowserCreatorTests for now #Patch Set 4 : merge up to r214457 -- fix conflict with r214339 -- dcommit since tests pass on previous patch set #
Messages
Total messages: 10 (0 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||