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

Issue 23068005: Convert UserPolicySigninService to use OAuth2TokenService (Closed)

Created:
7 years, 4 months ago by Andrew T Wilson (Slow)
Modified:
7 years, 4 months ago
CC:
chromium-reviews, nkostylev+watch_chromium.org, rpetterson, ahutter, browser-components-watch_chromium.org, rginda+watch_chromium.org, Raman Kakilate, markusheintz_, Ilya Sherman, tim+watch_chromium.org, extensions-reviews_chromium.org, benquan, stevenjb+watch_chromium.org, ajwong+watch_chromium.org, groby+spellwatch_chromium.org, chromium-apps-reviews_chromium.org, Avi (use Gerrit), creis+watch_chromium.org, haitaol+watch_chromium.org, rouslan+spellwatch_chromium.org, pam+watch_chromium.org, oshima+watch_chromium.org, Albert Bodenhamer, rouslan+autofillwatch_chromium.org, tfarina, Dane Wallinga, dyu1, estade+watch_chromium.org, rsimha+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Convert UserPolicySigninService to use OAuth2TokenService Updated UserPolicySigninService to use OAuth2TokenService and refactored the Android code to allow the android implementation to be shared with desktop. Added a FakeProfileOAuth2TokenService and added associated refactorings of OAuth2TokenService to support it. Updated various unit tests to use new FakeProfileOAuth2TokenService instead of rolling their own mocks. Updated TestingProfile::Builder to enable setting testing factories before any services are created - this is required because UserPolicySigninService is instantiated at profile creation time, and this means there is no way to inject a custom instance. Updated TestingProfile::Builder to support setting a TestingProfile as incognito at construction time. This is required because otherwise you have a situation where services will be created at profile creation time, that should not exist for incognito profiles. BUG=265831 TBR=estade,isherman Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=218990

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fixed more unittests. #

Patch Set 3 : More test fixes. #

Patch Set 4 : More compilation fixes! #

Patch Set 5 : Android fixes. #

Total comments: 44

Patch Set 6 : Addressed code review feedback. #

Total comments: 49

Patch Set 7 : Corrected comment. #

Total comments: 6

Patch Set 8 : More review comment fixups. #

Patch Set 9 : Merge with ToT #

Total comments: 2

Patch Set 10 : No longer inject SigninManager into UPSS. #

Total comments: 1

Patch Set 11 : Fix android typo #

Total comments: 4

Patch Set 12 : Updated documentation for ForceIncognito() #

Patch Set 13 : Merge with ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1029 lines, -646 lines) Patch
M chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/power/power_prefs_unittest.cc View 1 2 3 4 5 1 chunk +9 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/settings/device_oauth2_token_service.h View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/settings/device_oauth2_token_service.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/content_settings/content_settings_pref_provider_unittest.cc View 1 2 3 4 5 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/cookies/cookies_unittest.cc View 1 1 chunk +23 lines, -55 lines 0 comments Download
M chrome/browser/extensions/event_router_forwarder_unittest.cc View 1 chunk +7 lines, -4 lines 0 comments Download
M chrome/browser/extensions/menu_manager_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc View 1 2 3 4 5 6 7 19 chunks +49 lines, -119 lines 0 comments Download
M chrome/browser/password_manager/password_generation_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/policy/cloud/cloud_policy_client_registration_helper.h View 1 2 3 4 5 6 7 4 chunks +28 lines, -16 lines 0 comments Download
M chrome/browser/policy/cloud/cloud_policy_client_registration_helper.cc View 1 2 3 4 5 6 7 10 chunks +57 lines, -37 lines 0 comments Download
M chrome/browser/policy/cloud/user_policy_signin_service.h View 1 2 3 4 5 6 7 8 9 5 chunks +18 lines, -9 lines 0 comments Download
M chrome/browser/policy/cloud/user_policy_signin_service.cc View 1 2 3 4 5 6 7 8 9 7 chunks +43 lines, -66 lines 0 comments Download
M chrome/browser/policy/cloud/user_policy_signin_service_android.h View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/policy/cloud/user_policy_signin_service_android.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +7 lines, -8 lines 0 comments Download
M chrome/browser/policy/cloud/user_policy_signin_service_base.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/policy/cloud/user_policy_signin_service_base.cc View 1 2 3 4 5 6 7 8 9 5 chunks +11 lines, -5 lines 0 comments Download
M chrome/browser/policy/cloud/user_policy_signin_service_factory.cc View 1 2 3 4 5 6 7 8 9 4 chunks +10 lines, -10 lines 0 comments Download
M chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc View 1 2 3 4 5 6 7 15 chunks +98 lines, -52 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.cc View 1 2 3 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl_unittest.cc View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/profiles/profile_destroyer_unittest.cc View 1 2 3 4 5 1 chunk +8 lines, -1 line 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/profiles/profile_manager_unittest.cc View 6 chunks +14 lines, -16 lines 0 comments Download
M chrome/browser/signin/android_profile_oauth2_token_service.h View 1 2 3 4 2 chunks +14 lines, -21 lines 0 comments Download
M chrome/browser/signin/android_profile_oauth2_token_service.cc View 1 2 3 4 5 6 7 5 chunks +33 lines, -25 lines 0 comments Download
A chrome/browser/signin/fake_profile_oauth2_token_service.h View 1 2 3 4 5 6 7 8 9 1 chunk +111 lines, -0 lines 0 comments Download
A chrome/browser/signin/fake_profile_oauth2_token_service.cc View 1 2 3 4 5 6 1 chunk +120 lines, -0 lines 0 comments Download
M chrome/browser/signin/oauth2_token_service.h View 1 2 3 4 5 6 7 6 chunks +18 lines, -6 lines 0 comments Download
M chrome/browser/signin/oauth2_token_service.cc View 1 2 3 4 5 5 chunks +25 lines, -16 lines 0 comments Download
M chrome/browser/signin/profile_oauth2_token_service.h View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/signin/profile_oauth2_token_service.cc View 1 2 3 4 5 6 7 4 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/signin/profile_oauth2_token_service_factory.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc View 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/browser/signin/token_service_unittest.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/signin/token_service_unittest.cc View 1 2 3 4 5 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/signin/ubertoken_fetcher_unittest.cc View 1 2 3 4 1 chunk +7 lines, -3 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_autofill_unittest.cc View 1 2 6 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_password_unittest.cc View 1 2 3 4 5 6 7 4 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_preference_unittest.cc View 1 2 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_session_unittest.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_startup_unittest.cc View 1 2 3 4 5 7 chunks +24 lines, -24 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_typed_url_unittest.cc View 1 2 3 4 5 6 7 4 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_unittest.cc View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc View 8 chunks +14 lines, -13 lines 0 comments Download
M chrome/browser/translate/translate_manager_browsertest.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/bookmarks/bookmark_context_menu_controller_unittest.cc View 2 chunks +9 lines, -2 lines 0 comments Download
M chrome/browser/ui/browser_command_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/ui/sync/one_click_signin_helper.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/sync/one_click_signin_helper_unittest.cc View 1 2 3 4 5 13 chunks +28 lines, -17 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_context_menu_test.cc View 1 2 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view_unittest.cc View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.h View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +42 lines, -6 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +44 lines, -8 lines 0 comments Download
M chrome/test/base/testing_profile_manager.cc View 1 2 chunks +6 lines, -7 lines 0 comments Download
M components/autofill/core/browser/personal_data_manager_unittest.cc View 1 chunk +3 lines, -1 line 0 comments Download
M components/browser_context_keyed_service/browser_context_dependency_manager.h View 1 2 3 4 5 6 7 2 chunks +21 lines, -6 lines 0 comments Download
M components/browser_context_keyed_service/browser_context_dependency_manager.cc View 1 2 3 4 5 2 chunks +20 lines, -4 lines 0 comments Download
M components/browser_context_keyed_service/browser_context_keyed_base_factory.cc View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 31 (0 generated)
Andrew T Wilson (Slow)
mnissler, please review browser/policy (since joaodasilva is out) fgorski, please review browser/signin rsimha, PTAL at ...
7 years, 4 months ago (2013-08-16 16:37:59 UTC) #1
awong
drive-by with a bunch of little nits. FYI, I did the review from bottom up ...
7 years, 4 months ago (2013-08-16 17:53:06 UTC) #2
Elliot Glaysher
https://codereview.chromium.org/23068005/diff/98001/chrome/test/base/testing_profile.h File chrome/test/base/testing_profile.h (right): https://codereview.chromium.org/23068005/diff/98001/chrome/test/base/testing_profile.h#newcode87 chrome/test/base/testing_profile.h:87: BrowserContextKeyedServiceFactory::FactoryFunction callback); I'm fine with you adding this part ...
7 years, 4 months ago (2013-08-16 18:07:58 UTC) #3
fgorski
browser/signin lgtm with a few nits. https://codereview.chromium.org/23068005/diff/98001/chrome/browser/signin/fake_profile_oauth2_token_service.h File chrome/browser/signin/fake_profile_oauth2_token_service.h (right): https://codereview.chromium.org/23068005/diff/98001/chrome/browser/signin/fake_profile_oauth2_token_service.h#newcode50 chrome/browser/signin/fake_profile_oauth2_token_service.h:50: // OnRefreshTokensLoaded() will ...
7 years, 4 months ago (2013-08-16 18:41:06 UTC) #4
Andrew T Wilson (Slow)
Albert, thanks for the drive-by! erg: PTAL https://codereview.chromium.org/23068005/diff/98001/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc File chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc (right): https://codereview.chromium.org/23068005/diff/98001/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc#newcode98 chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc:98: profile_->SetOffTheRecordProfile(scoped_ptr<Profile>(signin_profile_)); On ...
7 years, 4 months ago (2013-08-19 12:15:56 UTC) #5
Andrew T Wilson (Slow)
finnur: PTAL at extensions/* bauerb: PTAL at managed_mode/* dbeam: PTAL at ui/autofill sky: PTAL at ...
7 years, 4 months ago (2013-08-19 13:11:38 UTC) #6
Andrew T Wilson (Slow)
Actually added dbeam/sky to the reviewers list :)
7 years, 4 months ago (2013-08-19 13:12:36 UTC) #7
Finnur
Extensions LGTM.
7 years, 4 months ago (2013-08-19 13:19:12 UTC) #8
Bernhard Bauer
https://codereview.chromium.org/23068005/diff/123001/chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc File chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc (right): https://codereview.chromium.org/23068005/diff/123001/chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc#newcode29 chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc:29: const char kOAuth2RefreshToken[] = "refreshtoken"; Could you move this ...
7 years, 4 months ago (2013-08-19 14:00:05 UTC) #9
Mattias Nissler (ping if slow)
Lots of comments :) This review should really be split into a TestingProfile refactor part ...
7 years, 4 months ago (2013-08-19 14:03:21 UTC) #10
Elliot Glaysher
https://codereview.chromium.org/23068005/diff/98001/chrome/test/base/testing_profile.h File chrome/test/base/testing_profile.h (right): https://codereview.chromium.org/23068005/diff/98001/chrome/test/base/testing_profile.h#newcode87 chrome/test/base/testing_profile.h:87: BrowserContextKeyedServiceFactory::FactoryFunction callback); On 2013/08/19 12:15:56, Andrew T Wilson wrote: ...
7 years, 4 months ago (2013-08-19 18:04:29 UTC) #11
awong
lgtm for drive-by with 1 more nit. https://codereview.chromium.org/23068005/diff/98001/chrome/browser/chromeos/power/power_prefs_unittest.cc File chrome/browser/chromeos/power/power_prefs_unittest.cc (right): https://codereview.chromium.org/23068005/diff/98001/chrome/browser/chromeos/power/power_prefs_unittest.cc#newcode160 chrome/browser/chromeos/power/power_prefs_unittest.cc:160: scoped_ptr<TestingProfile> login_profile_owner ...
7 years, 4 months ago (2013-08-19 19:47:20 UTC) #12
Dan Beam
c/b/ui/autofill lgtm
7 years, 4 months ago (2013-08-19 20:03:31 UTC) #13
Raghu Simha
chrome/browser/sync lgtm. https://codereview.chromium.org/23068005/diff/36001/chrome/browser/sync/profile_sync_service_password_unittest.cc File chrome/browser/sync/profile_sync_service_password_unittest.cc (right): https://codereview.chromium.org/23068005/diff/36001/chrome/browser/sync/profile_sync_service_password_unittest.cc#newcode35 chrome/browser/sync/profile_sync_service_password_unittest.cc:35: #include "chrome/test/base/profile_mock.h" This include seems unnecessary now. ...
7 years, 4 months ago (2013-08-20 00:16:28 UTC) #14
Andrew T Wilson (Slow)
isherman: PTAL for owners rubberstamp on components/autofill bauerb/mnissler: PTAL erg: Removed Set/ResetGlobalTestingFactory() - PTAL https://codereview.chromium.org/23068005/diff/123001/chrome/browser/managed_mode/managed_user_refresh_token_fetcher_unittest.cc ...
7 years, 4 months ago (2013-08-20 09:28:34 UTC) #15
Bernhard Bauer
c/b/managed_mode LGTM https://codereview.chromium.org/23068005/diff/183001/chrome/browser/signin/fake_profile_oauth2_token_service.h File chrome/browser/signin/fake_profile_oauth2_token_service.h (right): https://codereview.chromium.org/23068005/diff/183001/chrome/browser/signin/fake_profile_oauth2_token_service.h#newcode44 chrome/browser/signin/fake_profile_oauth2_token_service.h:44: ~PendingRequest(); Nit: Add a newline?
7 years, 4 months ago (2013-08-20 09:39:02 UTC) #16
Andrew T Wilson (Slow)
https://codereview.chromium.org/23068005/diff/123001/chrome/browser/policy/cloud/user_policy_signin_service.cc File chrome/browser/policy/cloud/user_policy_signin_service.cc (right): https://codereview.chromium.org/23068005/diff/123001/chrome/browser/policy/cloud/user_policy_signin_service.cc#newcode120 chrome/browser/policy/cloud/user_policy_signin_service.cc:120: SigninManagerFactory::GetForProfile(profile()); On 2013/08/20 09:28:35, Andrew T Wilson wrote: > ...
7 years, 4 months ago (2013-08-20 12:24:20 UTC) #17
Mattias Nissler (ping if slow)
Sorry for the delay... but dude, this review is still too damn big and I ...
7 years, 4 months ago (2013-08-20 16:00:27 UTC) #18
Andrew T Wilson (Slow)
On 2013/08/20 16:00:27, Mattias Nissler wrote: > Sorry for the delay... but dude, this review ...
7 years, 4 months ago (2013-08-20 16:18:54 UTC) #19
Elliot Glaysher
profiles lgtm
7 years, 4 months ago (2013-08-20 19:20:41 UTC) #20
Andrew T Wilson (Slow)
sky: PING for owners stamp on ui/* changes and changes under chrome/test/base toyoshim: PTAL at ...
7 years, 4 months ago (2013-08-21 07:07:36 UTC) #21
Andrew T Wilson (Slow)
sky: PING for owners stamp on ui/* changes and changes under chrome/test/base toyoshim: owners stamp ...
7 years, 4 months ago (2013-08-21 07:10:06 UTC) #22
Takashi Toyoshima
translate/ lgtm
7 years, 4 months ago (2013-08-21 07:41:38 UTC) #23
sky
https://codereview.chromium.org/23068005/diff/203001/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc File chrome/browser/ui/sync/one_click_signin_helper_unittest.cc (right): https://codereview.chromium.org/23068005/diff/203001/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc#newcode379 chrome/browser/ui/sync/one_click_signin_helper_unittest.cc:379: return builder.Build().release(); Who ends up owning this? https://codereview.chromium.org/23068005/diff/203001/chrome/test/base/testing_profile.h File ...
7 years, 4 months ago (2013-08-21 13:48:30 UTC) #24
Avi (use Gerrit)
browser/tab_contents LGTM
7 years, 4 months ago (2013-08-21 14:44:47 UTC) #25
Andrew T Wilson (Slow)
sky: PTAL. I've updated the documentation for ForceIncognito() to explain exactly why it's deprecated. https://codereview.chromium.org/23068005/diff/203001/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc ...
7 years, 4 months ago (2013-08-21 15:25:49 UTC) #26
Andrew T Wilson (Slow)
estade: OWNERS stamp for components/autofill tim: OWNERS stamp for chrome/browser/password_manager Thanks!
7 years, 4 months ago (2013-08-21 15:30:36 UTC) #27
Nikita (slow)
On 2013/08/21 07:10:06, Andrew T Wilson wrote: > nkostylev: owners stamp for chrome/browser/chromeos/power/* lgtm
7 years, 4 months ago (2013-08-21 15:56:30 UTC) #28
sky
Fair enough, LGTM - but add a TODO and file a bug to nuke the ...
7 years, 4 months ago (2013-08-21 15:59:17 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/atwilson@chromium.org/23068005/203002
7 years, 4 months ago (2013-08-22 08:31:53 UTC) #30
commit-bot: I haz the power
7 years, 4 months ago (2013-08-22 10:49:44 UTC) #31
Message was sent while issue was closed.
Change committed as 218990

Powered by Google App Engine
This is Rietveld 408576698