1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 * Displays a webview based authorization dialog.
7 * @param {string} key A unique identifier that the caller can use to locate
9 * @param {string} url A URL that will be loaded in the webview.
10 * @param {string} mode 'interactive' or 'silent'. The window will be displayed
11 * if the mode is 'interactive'.
13 function showAuthDialog(key, url, mode) {
21 chrome.app.window.create('scope_approval_dialog.html',
24 win.contentWindow.addEventListener('load', function(event) {
26 if (mode == 'interactive')
28 win.contentWindow.loadAuthUrlAndShowWindow(url, windowParam);
33 chrome.identityPrivate.onWebFlowRequest.addListener(showAuthDialog);