|
Introduce Identity Service and its initial usage
This CL introduces the Identity Service and converts the implementation
of the chrome.identity.GetProfileUserInfo() extension function to use
the new service. Notable points:
- The Identity Service is embedded in //chrome rather than //content,
as it needs access to per-Profile classes with //chrome-level
factories.
- The initial API is simply enough to satisfy the needs of the initial
consumer. We will build out this API by incrementally converting
further consumers.
- In the long term, the //components/signin classes on which the
Identity Service depends will be folded into the Identity Service
implementation, and their consumers will be converted to consume the
Identity Service.
- The Identity Service makes use of the existing AccountId Mojo struct.
It extends that struct to be nullable, as the Identity Service needs
to be able to convey to a requesting client that the user is not
signed in. Note that a separate HasPrimaryAccount() => bool method
would not suffice here: since the communication is asynchronous, the
user could always have signed out by the time that the Identity
Service receives the GetPrimaryAccountId() call.
BUG= 683120, 683124
TEST=Install a Chrome extension with the identity and identity.email
permissions in its manifest. Go to chrome://extensions, enable developer mode,
and inspect the background page of the above app. At the JS console that that
brings up, execute:
chrome.identity.getProfileUserInfo((account) => {console.log(account)})
Verify that the printout corresponds to the information of the account
being used for sync.
Review-Url: https://codereview.chromium.org/2753753007
Cr-Commit-Position: refs/heads/master@{#459410}
Committed: https://chromium.googlesource.com/chromium/src/+/b85bd3b039159890285ab7df4bf280f89cd9980f
Total comments: 15
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+328 lines, -10 lines) |
Patch |
|
M |
chrome/app/BUILD.gn
|
View
|
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/BUILD.gn
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/DEPS
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/chrome_content_browser_manifest_overlay.json
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/BUILD.gn
|
View
|
1
2
3
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.h
|
View
|
1
2
|
2 chunks |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc
|
View
|
1
2
3
4
|
2 chunks |
+29 lines, -9 lines |
0 comments
|
Download
|
|
M |
chrome/browser/profiles/DEPS
|
View
|
1
2
3
4
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/profiles/profile_impl.h
|
View
|
1
2
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/profiles/profile_impl.cc
|
View
|
1
2
3
|
3 chunks |
+20 lines, -0 lines |
0 comments
|
Download
|
|
M |
components/signin/public/interfaces/account_id_traits.h
|
View
|
1
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
services/device/device_service.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/BUILD.gn
|
View
|
|
1 chunk |
+29 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/DEPS
|
View
|
1
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/OWNERS
|
View
|
1
2
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/README.md
|
View
|
1
2
3
4
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/identity_manager.h
|
View
|
|
1 chunk |
+32 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/identity_manager.cc
|
View
|
1
|
1 chunk |
+39 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/identity_service.h
|
View
|
|
1 chunk |
+40 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/identity_service.cc
|
View
|
1
|
1 chunk |
+32 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/manifest.json
|
View
|
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/public/interfaces/BUILD.gn
|
View
|
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/public/interfaces/OWNERS
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/public/interfaces/constants.mojom
|
View
|
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
services/identity/public/interfaces/identity_manager.mojom
|
View
|
1
2
3
4
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
Total messages: 40 (24 generated)
|