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

Issue 20483002: Merge 3 different ways of obtaining first run state into a single one. (Closed)

Created:
7 years, 4 months ago by gab
Modified:
7 years, 4 months ago
CC:
chromium-reviews, benwells
Visibility:
Public.

Description

Merge 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -90 lines) Patch
M chrome/browser/chrome_browser_main.h View 1 3 chunks +1 line, -4 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 12 chunks +45 lines, -70 lines 0 comments Download
M chrome/browser/chrome_browser_main_win.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/first_run/first_run.h View 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/first_run/first_run.cc View 3 chunks +26 lines, -12 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
gab
Carlos, please take a look, I tried to make the description as descriptive as possible ...
7 years, 4 months ago (2013-07-26 15:41:13 UTC) #1
cpu_(ooo_6.6-7.5)
Haven't started actual review but I wonder about case #3, should it really create the ...
7 years, 4 months ago (2013-07-26 21:35:00 UTC) #2
gab
--no-first-run creates the sentinel by definition (see comment by declaration of kNoFirstRun) It's used by ...
7 years, 4 months ago (2013-07-26 23:14:01 UTC) #3
cpu_(ooo_6.6-7.5)
lgtm https://codereview.chromium.org/20483002/diff/10002/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (left): https://codereview.chromium.org/20483002/diff/10002/chrome/browser/chrome_browser_main.cc#oldcode988 chrome/browser/chrome_browser_main.cc:988: !parsed_command_line().HasSwitch(switches::kApp) && On 2013/07/26 15:41:13, gab wrote: > ...
7 years, 4 months ago (2013-07-27 21:16:31 UTC) #4
gab
@jam: This gets rid of do_first_run_tasks_ which I gather from https://codereview.chromium.org/19689006 you wanted to move. ...
7 years, 4 months ago (2013-07-29 17:39:49 UTC) #5
benwells1
-- from a tablet: terse and error prone On Jul 30, 2013 3:39 AM, <gab@chromium.org> ...
7 years, 4 months ago (2013-07-29 22:17:27 UTC) #6
gab
https://codereview.chromium.org/20483002/diff/10002/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (left): https://codereview.chromium.org/20483002/diff/10002/chrome/browser/chrome_browser_main.cc#oldcode988 chrome/browser/chrome_browser_main.cc:988: !parsed_command_line().HasSwitch(switches::kApp) && On 2013/07/29 17:39:50, gab wrote: > On ...
7 years, 4 months ago (2013-07-29 22:22:29 UTC) #7
jam
not really familiar with this code, rubberstamp lgtm based on cpu's review
7 years, 4 months ago (2013-07-29 23:09:10 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/20483002/56001
7 years, 4 months ago (2013-07-30 20:47:51 UTC) #9
gab
7 years, 4 months ago (2013-07-31 02:14:09 UTC) #10
Message was sent while issue was closed.
Committed patchset #4 manually as r214514 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698