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

Issue 10656033: [sync] Automatic bootstrapping of Sync on Win 8 from cached credentials (Closed)

Created:
8 years, 6 months ago by Raghu Simha
Modified:
8 years, 5 months ago
CC:
chromium-reviews, Raghu Simha, ncarter (slow), akalin, tim (not reviewing)
Visibility:
Public.

Description

[sync] Automatic bootstrapping of Sync on Win 8 from cached credentials Windows 8 has both a classic "Desktop" mode and a new "Metro" mode, that must use different browser processes because Chrome profile data stores can only be accessed from one profile at a time, and it is not technically feasible to allow multi process access today. The short term solution to making the experience less jarring on Windows 8 is to cache the sync credentials in a separate file when the user signs in on either Metro or Desktop, so that they can be used to auto-start sync on the alternate profile (Desktop or Metro) when it is opened. This patch contains the following changes: - A new class CredentialCacheService, that contains code capable of encrypting and persisting the google username, the lsid and sid, the encryption bootstrap token, and a list of enabled / disabled sync datatypes to a json encoded "Sync Credentials" file in the profile directory. - Methods that listen to the PrefService and TokenService for changes to the above credentials and persist them when the user successfully signs in manually. - Code in ProfileSyncService that detects that we are running on Windows 8, and if sync has never been set up, tries to load cached credentials from the alternate Metro / Desktop profile, and if they were found, bootstrap sync using the credentials. - Mechanisms to detect that we are using the "Default" profile on Metro or Desktop. As of today, Metro Chrome on Windows 8 does not support multiple profiles, and there is no good way to pair up a non-default profile directory ("Profile 1", "Profile 2", etc.) on Desktop to its corresponding directory on Metro and vice versa. - Unit tests for functionality in credential_cache_service_win.{h|cc}. BUG=139199, 139200 TEST=Sign in to sync on Desktop, launch Metro, and watch sync automatically start up Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=148624

Patch Set 1 : "" #

Total comments: 53

Patch Set 2 : Major redesign with service / factory + notifications. #

Patch Set 3 : Fix unit tests #

Total comments: 30

Patch Set 4 : CR Feedback #

Total comments: 2

Patch Set 5 : Fix TokenServiceTests #

Total comments: 18

Patch Set 6 : More CR Feedback #

Total comments: 2

Patch Set 7 : Fix nits #

Total comments: 4

Patch Set 8 : Fully decouple PSS and CCS. #

Total comments: 6

Patch Set 9 : Auto-initialize CCSFactory with Profile. #

Total comments: 1

Patch Set 10 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+964 lines, -41 lines) Patch
M chrome/browser/profiles/profile_dependency_manager.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/signin/token_service.h View 1 2 3 4 5 6 7 8 2 chunks +15 lines, -0 lines 0 comments Download
M chrome/browser/signin/token_service.cc View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download
A chrome/browser/sync/credential_cache_service_factory_win.h View 1 2 3 4 5 6 7 8 1 chunk +44 lines, -0 lines 0 comments Download
A chrome/browser/sync/credential_cache_service_factory_win.cc View 1 2 3 4 5 6 7 8 1 chunk +68 lines, -0 lines 0 comments Download
A chrome/browser/sync/credential_cache_service_win.h View 1 2 3 4 5 6 7 8 1 chunk +185 lines, -0 lines 0 comments Download
A chrome/browser/sync/credential_cache_service_win.cc View 1 2 3 4 5 6 7 8 9 1 chunk +443 lines, -0 lines 0 comments Download
A chrome/browser/sync/credential_cache_service_win_unittest.cc View 1 2 3 4 5 6 7 1 chunk +136 lines, -0 lines 0 comments Download
M chrome/browser/sync/sync_prefs.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/sync_prefs.cc View 1 2 3 4 5 2 chunks +38 lines, -41 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_constants.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_constants.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_notification_types.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
Raghu Simha
Tim/Roger/Drew: Please review, and let me know what you think of this approach. Drew: Code ...
8 years, 6 months ago (2012-06-26 01:32:05 UTC) #1
Andrew T Wilson (Slow)
So, the thing I'd like to see changed is how this logic is threaded through ...
8 years, 5 months ago (2012-06-26 23:26:13 UTC) #2
Raghu Simha
Drew: Some preliminary responses to your comments. Thanks for the very insightful code review. I'll ...
8 years, 5 months ago (2012-06-27 00:17:04 UTC) #3
Roger Tawa OOO till Jul 10th
Hi Raghu, sorry for the late response. See comments below. Thanks. http://codereview.chromium.org/10656033/diff/16001/chrome/browser/signin/signin_manager.cc File chrome/browser/signin/signin_manager.cc (right): ...
8 years, 5 months ago (2012-06-27 21:23:28 UTC) #4
Raghu Simha
Drew / Roger / Tim: Sorry about the time it took to update this patch. ...
8 years, 5 months ago (2012-07-19 06:57:06 UTC) #5
Andrew T Wilson (Slow)
I like the direction this has taken - I have a few concerns about us ...
8 years, 5 months ago (2012-07-20 01:04:04 UTC) #6
Raghu Simha
Thanks for all the feedback Drew. I've done more decoupling -- let me know what ...
8 years, 5 months ago (2012-07-20 23:35:22 UTC) #7
Raghu Simha
http://codereview.chromium.org/10656033/diff/37024/chrome/browser/signin/token_service.cc File chrome/browser/signin/token_service.cc (right): http://codereview.chromium.org/10656033/diff/37024/chrome/browser/signin/token_service.cc#newcode127 chrome/browser/signin/token_service.cc:127: // Notify the CredentialCacheService that a new lsid and ...
8 years, 5 months ago (2012-07-21 01:15:45 UTC) #8
Raghu Simha
http://codereview.chromium.org/10656033/diff/37024/chrome/browser/signin/token_service.cc File chrome/browser/signin/token_service.cc (right): http://codereview.chromium.org/10656033/diff/37024/chrome/browser/signin/token_service.cc#newcode127 chrome/browser/signin/token_service.cc:127: // Notify the CredentialCacheService that a new lsid and ...
8 years, 5 months ago (2012-07-21 02:00:55 UTC) #9
Roger Tawa OOO till Jul 10th
Looks good Raghu. A few questions below. http://r879-cab51e0eb6a4-rogerta.chromiumcodereview-hr.appspot.com/10656033/diff/49057/chrome/browser/signin/token_service.cc File chrome/browser/signin/token_service.cc (right): http://r879-cab51e0eb6a4-rogerta.chromiumcodereview-hr.appspot.com/10656033/diff/49057/chrome/browser/signin/token_service.cc#newcode240 chrome/browser/signin/token_service.cc:240: content::Details<const TokenAvailableDetails>(&details)); ...
8 years, 5 months ago (2012-07-23 15:10:33 UTC) #10
Raghu Simha
Thanks for the feedback, Roger. PTAL. http://codereview.chromium.org/10656033/diff/49057/chrome/browser/signin/token_service.cc File chrome/browser/signin/token_service.cc (right): http://codereview.chromium.org/10656033/diff/49057/chrome/browser/signin/token_service.cc#newcode240 chrome/browser/signin/token_service.cc:240: content::Details<const TokenAvailableDetails>(&details)); On ...
8 years, 5 months ago (2012-07-23 20:35:54 UTC) #11
Roger Tawa OOO till Jul 10th
Awesome Raghu, lgtm http://r879-cab51e0eb6a4-rogerta.chromiumcodereview-hr.appspot.com/10656033/diff/39076/chrome/browser/sync/credential_cache_service_win.h File chrome/browser/sync/credential_cache_service_win.h (right): http://r879-cab51e0eb6a4-rogerta.chromiumcodereview-hr.appspot.com/10656033/diff/39076/chrome/browser/sync/credential_cache_service_win.h#newcode102 chrome/browser/sync/credential_cache_service_win.h:102: scoped_refptr<JsonPrefStore> local_store() const { return local_store_; ...
8 years, 5 months ago (2012-07-24 14:13:42 UTC) #12
Raghu Simha
Thanks Roger. Drew, let me know if you have any more comments. http://codereview.chromium.org/10656033/diff/39076/chrome/browser/sync/credential_cache_service_win.h File chrome/browser/sync/credential_cache_service_win.h ...
8 years, 5 months ago (2012-07-24 17:19:55 UTC) #13
Andrew T Wilson (Slow)
http://codereview.chromium.org/10656033/diff/38028/chrome/browser/signin/token_service.cc File chrome/browser/signin/token_service.cc (right): http://codereview.chromium.org/10656033/diff/38028/chrome/browser/signin/token_service.cc#newcode240 chrome/browser/signin/token_service.cc:240: content::Details<const TokenAvailableDetails>(&details)); Either we should just send out TOKEN_AVAILABLE ...
8 years, 5 months ago (2012-07-24 18:00:33 UTC) #14
Raghu Simha
Thanks for the review, Drew. PTAL. Tim: Could you look at the change to profile_impl.cc? ...
8 years, 5 months ago (2012-07-24 20:45:03 UTC) #15
Andrew T Wilson (Slow)
http://codereview.chromium.org/10656033/diff/37044/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): http://codereview.chromium.org/10656033/diff/37044/chrome/browser/profiles/profile_impl.cc#newcode863 chrome/browser/profiles/profile_impl.cc:863: syncer::CredentialCacheServiceFactory::GetInstance()->GetForProfile(this); I think the cleaner way to do this ...
8 years, 5 months ago (2012-07-24 20:55:29 UTC) #16
Andrew T Wilson (Slow)
http://codereview.chromium.org/10656033/diff/37044/chrome/browser/signin/token_service.h File chrome/browser/signin/token_service.h (right): http://codereview.chromium.org/10656033/diff/37044/chrome/browser/signin/token_service.h#newcode99 chrome/browser/signin/token_service.h:99: CredentialsUpdatedDetails() {} Do we need this default constructor? Seems ...
8 years, 5 months ago (2012-07-24 20:57:41 UTC) #17
Raghu Simha
Thanks Drew. PTAL. http://codereview.chromium.org/10656033/diff/37044/chrome/browser/profiles/profile_impl.cc File chrome/browser/profiles/profile_impl.cc (right): http://codereview.chromium.org/10656033/diff/37044/chrome/browser/profiles/profile_impl.cc#newcode863 chrome/browser/profiles/profile_impl.cc:863: syncer::CredentialCacheServiceFactory::GetInstance()->GetForProfile(this); On 2012/07/24 20:55:29, Andrew T ...
8 years, 5 months ago (2012-07-24 22:17:35 UTC) #18
tim (not reviewing)
LGTM, but I'm not actually an OWNER for profiles/ (not sure why the presubmit script ...
8 years, 5 months ago (2012-07-24 23:49:25 UTC) #19
Elliot Glaysher
lgtm http://codereview.chromium.org/10656033/diff/51042/chrome/browser/sync/credential_cache_service_factory_win.cc File chrome/browser/sync/credential_cache_service_factory_win.cc (right): http://codereview.chromium.org/10656033/diff/51042/chrome/browser/sync/credential_cache_service_factory_win.cc#newcode36 chrome/browser/sync/credential_cache_service_factory_win.cc:36: // DependsOn(PrefServiceFactory::GetInstance()); Thank you for adding these todos. ...
8 years, 5 months ago (2012-07-24 23:59:32 UTC) #20
Raghu Simha
+sky Looks like I still need owners approval for chrome/chrome_browser.gypi and chrome/chrome_tests.gypi. I picked a ...
8 years, 5 months ago (2012-07-26 01:04:48 UTC) #21
Andrew T Wilson (Slow)
LGTM!
8 years, 5 months ago (2012-07-26 20:28:07 UTC) #22
jam
8 years, 5 months ago (2012-07-26 21:11:17 UTC) #23
lgtm

Powered by Google App Engine
This is Rietveld 408576698