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

Issue 12662033: Show user data dialog earlier on Windows. (Closed)

Created:
7 years, 9 months ago by hshi1
Modified:
7 years, 9 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Show user data dialog earlier on Windows. On Windows if the user data directory does not exist, we must show the user data dir picker dialog prior to creating the local state to avoid a CHECK failure. After obtaining the new dir we will restart chrome with the switch --user-data-dir appended to the command line. BUG=196301 TEST=CQ Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=190833

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rebased at trunk@189844. #

Patch Set 3 : Move the user_data_dir check to PreCreateThreadImpl as suggested by Mattias. #

Patch Set 4 : Fix compile errors on Windows. #

Patch Set 5 : Move the GetUserDataDir logic out to a separate function. #

Patch Set 6 : Add a browser test as suggested by Scott. #

Total comments: 4

Patch Set 7 : Fix typo that causes windows compiler error. #

Patch Set 8 : Reorg and refactor. #

Patch Set 9 : Reorg, refactor and fix compiler errors. #

Patch Set 10 : Fix windows build failures. #

Total comments: 19

Patch Set 11 : Forgot to return user_data_dir. #

Patch Set 12 : Fix redeclaration. #

Patch Set 13 : More fixes. #

Patch Set 14 : Rebased at trunk@190461. #

Total comments: 2

Patch Set 15 : Update gypi files as suggested. #

Patch Set 16 : Fix more compiler errors for the windows browser test. #

Patch Set 17 : Fix FilePath constructor link error. #

Patch Set 18 : Bogus user data dir is hard. Verify timing instead: GetUserDataDir before CreateLocalState. #

Patch Set 19 : Fix compile errors, rename. #

Patch Set 20 : It seems we need the public accessors after all. #

Total comments: 2

Patch Set 21 : Fix testing browser process created_local_state(). #

Patch Set 22 : Fix the SIGSEGV in the GetUserDataDir callback. #

Patch Set 23 : Fix chromium style warning: inline virtual method with non-empty bodies. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -36 lines) Patch
M chrome/browser/browser_process.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/browser_process_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/browser_process_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 3 chunks +2 lines, -36 lines 0 comments Download
A chrome/browser/user_data_dir_extractor.h View 1 2 3 4 5 6 7 1 chunk +23 lines, -0 lines 0 comments Download
A chrome/browser/user_data_dir_extractor.cc View 1 2 3 4 5 6 7 8 12 13 14 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/browser/user_data_dir_extractor_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +22 lines, -0 lines 0 comments Download
A chrome/browser/user_data_dir_extractor_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +68 lines, -0 lines 0 comments Download
A chrome/browser/user_data_dir_extractor_win_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +74 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/test/base/testing_browser_process.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/testing_browser_process.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
Mattias Nissler (ping if slow)
I think the idea is the right one, but I'd move the check. Also, the ...
7 years, 9 months ago (2013-03-22 17:48:24 UTC) #1
hshi1
How about patch set #3? Thanks! https://codereview.chromium.org/12662033/diff/1/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/12662033/diff/1/chrome/browser/chrome_browser_main.cc#newcode817 chrome/browser/chrome_browser_main.cc:817: PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_); On ...
7 years, 9 months ago (2013-03-22 17:59:03 UTC) #2
Mattias Nissler (ping if slow)
LGTM from my side, but you'll need OWNERS approval as well.
7 years, 9 months ago (2013-03-22 18:19:57 UTC) #3
hshi1
Sky/Ben - can one of you review this as owner? Thanks.
7 years, 9 months ago (2013-03-22 18:25:19 UTC) #4
sky
Code like this is fragile. Can you add a test to make sure its executed ...
7 years, 9 months ago (2013-03-22 19:34:53 UTC) #5
hshi1
Technically we can unit-test this (for windows only) by creating a mock chrome::ShowUserDataDirDialog then call ...
7 years, 9 months ago (2013-03-22 20:10:06 UTC) #6
sky
manual=its going to break again and no one will know. On Fri, Mar 22, 2013 ...
7 years, 9 months ago (2013-03-22 20:12:03 UTC) #7
hshi1
On 2013/03/22 20:12:03, sky wrote: > manual=its going to break again and no one will ...
7 years, 9 months ago (2013-03-22 20:23:23 UTC) #8
hshi1
Please review Patch Set #6 then. It is rather ugly but it is what seems ...
7 years, 9 months ago (2013-03-22 22:29:20 UTC) #9
sky
https://codereview.chromium.org/12662033/diff/25001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/12662033/diff/25001/chrome/browser/chrome_browser_main.cc#newcode358 chrome/browser/chrome_browser_main.cc:358: base::FilePath GetUserDataDir(const content::MainFunctionParams& parameters) { Move all of this ...
7 years, 9 months ago (2013-03-22 23:14:27 UTC) #10
hshi1
CL updated, please review again. Thanks! https://codereview.chromium.org/12662033/diff/25001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/12662033/diff/25001/chrome/browser/chrome_browser_main.cc#newcode358 chrome/browser/chrome_browser_main.cc:358: base::FilePath GetUserDataDir(const content::MainFunctionParams& ...
7 years, 9 months ago (2013-03-22 23:51:04 UTC) #11
sky
https://codereview.chromium.org/12662033/diff/54001/chrome/browser/chrome_main_browsertest.cc File chrome/browser/chrome_main_browsertest.cc (right): https://codereview.chromium.org/12662033/diff/54001/chrome/browser/chrome_main_browsertest.cc#newcode147 chrome/browser/chrome_main_browsertest.cc:147: class ChromeMainUserDataDirTest : public InProcessBrowserTest { Move this to ...
7 years, 9 months ago (2013-03-25 15:43:14 UTC) #12
hshi1
https://codereview.chromium.org/12662033/diff/54001/chrome/browser/chrome_main_browsertest.cc File chrome/browser/chrome_main_browsertest.cc (right): https://codereview.chromium.org/12662033/diff/54001/chrome/browser/chrome_main_browsertest.cc#newcode147 chrome/browser/chrome_main_browsertest.cc:147: class ChromeMainUserDataDirTest : public InProcessBrowserTest { On 2013/03/25 15:43:14, ...
7 years, 9 months ago (2013-03-25 17:18:55 UTC) #13
sky
https://codereview.chromium.org/12662033/diff/54001/chrome/browser/user_data_dir_extractor_win.cc File chrome/browser/user_data_dir_extractor_win.cc (right): https://codereview.chromium.org/12662033/diff/54001/chrome/browser/user_data_dir_extractor_win.cc#newcode42 chrome/browser/user_data_dir_extractor_win.cc:42: if (g_custom_show_user_data_dir_dialog_callback) { On 2013/03/25 17:18:55, hshi1 wrote: > ...
7 years, 9 months ago (2013-03-25 19:19:04 UTC) #14
hshi1
https://codereview.chromium.org/12662033/diff/54001/chrome/browser/user_data_dir_extractor_win.cc File chrome/browser/user_data_dir_extractor_win.cc (right): https://codereview.chromium.org/12662033/diff/54001/chrome/browser/user_data_dir_extractor_win.cc#newcode42 chrome/browser/user_data_dir_extractor_win.cc:42: if (g_custom_show_user_data_dir_dialog_callback) { On 2013/03/25 19:19:04, sky wrote: > ...
7 years, 9 months ago (2013-03-25 19:31:15 UTC) #15
sky
LGTM with the following change. https://codereview.chromium.org/12662033/diff/79004/chrome/browser/user_data_dir_extractor.cc File chrome/browser/user_data_dir_extractor.cc (right): https://codereview.chromium.org/12662033/diff/79004/chrome/browser/user_data_dir_extractor.cc#newcode14 chrome/browser/user_data_dir_extractor.cc:14: #if !defined(OS_WIN) Nuke this ...
7 years, 9 months ago (2013-03-25 21:43:20 UTC) #16
hshi1
https://codereview.chromium.org/12662033/diff/79004/chrome/browser/user_data_dir_extractor.cc File chrome/browser/user_data_dir_extractor.cc (right): https://codereview.chromium.org/12662033/diff/79004/chrome/browser/user_data_dir_extractor.cc#newcode14 chrome/browser/user_data_dir_extractor.cc:14: #if !defined(OS_WIN) On 2013/03/25 21:43:20, sky wrote: > Nuke ...
7 years, 9 months ago (2013-03-25 22:10:14 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hshi@chromium.org/12662033/93004
7 years, 9 months ago (2013-03-26 00:06:51 UTC) #18
hshi1
On 2013/03/26 00:06:51, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
7 years, 9 months ago (2013-03-26 03:04:09 UTC) #19
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=23866
7 years, 9 months ago (2013-03-26 04:03:53 UTC) #20
sky
Off the top of my head I don't know. You'll have to trace through the ...
7 years, 9 months ago (2013-03-26 14:33:49 UTC) #21
hshi1
sky@ - can you review the latest patch set? I have decided to not pursue ...
7 years, 9 months ago (2013-03-26 17:30:36 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hshi@chromium.org/12662033/101004
7 years, 9 months ago (2013-03-26 20:36:46 UTC) #23
sky
https://codereview.chromium.org/12662033/diff/101004/chrome/test/base/testing_browser_process.h File chrome/test/base/testing_browser_process.h (right): https://codereview.chromium.org/12662033/diff/101004/chrome/test/base/testing_browser_process.h#newcode114 chrome/test/base/testing_browser_process.h:114: virtual bool created_local_state() const OVERRIDE { return false; } ...
7 years, 9 months ago (2013-03-26 20:50:48 UTC) #24
hshi1
https://codereview.chromium.org/12662033/diff/101004/chrome/test/base/testing_browser_process.h File chrome/test/base/testing_browser_process.h (right): https://codereview.chromium.org/12662033/diff/101004/chrome/test/base/testing_browser_process.h#newcode114 chrome/test/base/testing_browser_process.h:114: virtual bool created_local_state() const OVERRIDE { return false; } ...
7 years, 9 months ago (2013-03-26 20:54:11 UTC) #25
hshi1
Sorry, but this test doesn't seem to work. The problem is that during InProcessBrowserTest::SetUp(), the ...
7 years, 9 months ago (2013-03-26 21:25:40 UTC) #26
hshi1
The g_browser_process is created in ChromeBrowserMainParts::PreCreateThreads(), after GetUserDataDir(), but before initialize LocalState. Thus it is ...
7 years, 9 months ago (2013-03-26 21:38:21 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hshi@chromium.org/12662033/117007
7 years, 9 months ago (2013-03-26 21:49:35 UTC) #28
commit-bot: I haz the power
7 years, 9 months ago (2013-03-27 06:44:46 UTC) #29
Message was sent while issue was closed.
Change committed as 190833

Powered by Google App Engine
This is Rietveld 408576698