Commit dbcff222 authored by Bruno Santos's avatar Bruno Santos Committed by Commit Bot

Make contained home bridge receive scopes to get auth token.

Bug: 927809
Change-Id: I8d0aa79c00699f95f7e79cd673a92f39529b7d04
Reviewed-on: https://chromium-review.googlesource.com/c/1474047Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Commit-Queue: Bruno Santos <brunoad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633704}
parent 6c920b27
...@@ -25,10 +25,12 @@ containedHome.Bridge = class { ...@@ -25,10 +25,12 @@ containedHome.Bridge = class {
addListener(listener) {} addListener(listener) {}
/** /**
* Returns an access token with scope for the contained home experience. * Returns an access token with the requested scopes.
* @param {!Array<string>} scopes List of scopes to use when obtaining access
* token.
* @return {!Promise<string>} Promise for the access token. * @return {!Promise<string>} Promise for the access token.
*/ */
getAccessToken() {} getAccessToken(scopes) {}
/** /**
* Returns a list of apps installed in the user session. * Returns a list of apps installed in the user session.
......
...@@ -33,9 +33,9 @@ class ContainedHomeBridge { ...@@ -33,9 +33,9 @@ class ContainedHomeBridge {
} }
/** @override */ /** @override */
getAccessToken() { getAccessToken(scopes) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
chrome.identity.getAuthToken({'scopes': []}, token => { chrome.identity.getAuthToken({'scopes': scopes}, token => {
if (token) { if (token) {
resolve(token); resolve(token);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment