New issue
Advanced search Search tips

Issue 729537 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 729533
issue 729536

Blocking:
issue 683124



Sign in to add a comment

Convert implementation of chrome.identity.getAccounts() to use Identity Service

Project Member Reported by blundell@chromium.org, Jun 5 2017

Issue description

Once the blocking bugs are fixed, this should be relatively straightforward.
 
Labels: IdentityService
Blocking: 683124
Blockedon: 729533 729536
Owner: blundell@chromium.org
Status: Started (was: Available)
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bf44268201f947d844fb2667ca2b618d1d4213d8

commit bf44268201f947d844fb2667ca2b618d1d4213d8
Author: Colin Blundell <blundell@chromium.org>
Date: Fri Jul 28 13:08:05 2017

[Identity Service] Add GetAccounts() API

This CL adds an API to the Identity Service to get a list of all
accounts. This API has the following semantics, using the needs of
the chrome.identity.getAccounts() extension API as a guide:
- Returns the primary account (if any) first
- Returns only accounts for which a refresh token is available

This CL also adds the Account mojom struct to wrap AccountInfo and
AccountState. This change is necessary in order to easily return a
list of (AccountInfo, AccountState) pairs. A followup CL will change
all of the IdentityManager APIs to talk in terms of Account.

Finally, this CL ports the implementation of chrome.identity.getAccounts()
to use the new Identity Service API as an initial customer and
validation of the API. We preserve the existing semantics of the
chrome.identity.getAccounts() implementation wrt the primary account:
the impl returns an empty list if there is no primary account or if the
primary account doesn't have a refresh token, just as it did before. We
also augment the tests of that implementation with tests of this semantics,
as nothing was testing this behavior before.

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.getAccounts((accounts) => {console.log(accounts[0]);} )
Verify that the user's GAIA ID (a long string of numbers) appears rather
than an error being reported.

Bug:  729533 ,  729537 
Test: Install a Chrome extension with the identity permissions in its
Change-Id: Ibd4ea6843fc5c78738286f280d973a4a19176f23
Reviewed-on: https://chromium-review.googlesource.com/583069
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490376}
[modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/chrome/browser/extensions/api/identity/identity_apitest.cc
[modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/chrome/browser/extensions/api/identity/identity_get_accounts_function.cc
[modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/chrome/browser/extensions/api/identity/identity_get_accounts_function.h
[modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/README.md
[modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/identity_manager.cc
[modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/identity_manager.h
[modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/identity_manager_unittest.cc
[modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/public/interfaces/BUILD.gn
[add] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/public/interfaces/account.mojom
[modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/public/interfaces/identity_manager.mojom

Status: Fixed (was: Started)
Components: Internals>Services>Identity

Sign in to add a comment