Elim cr-checkbox
[chromium-blink-merge.git] / chrome / browser / resources / identity_scope_approval_dialog / background.js
blob4139360ae3e60c978537cf746aae7a0482187936
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.
5 /**
6 * Displays a webview based authorization dialog.
7 * @param {string} key A unique identifier that the caller can use to locate
8 * the dialog window.
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) {
14 var options = {
15 frame: 'none',
16 id: key,
17 minWidth: 1024,
18 minHeight: 768,
19 hidden: true
21 chrome.app.window.create('scope_approval_dialog.html',
22 options,
23 function(win) {
24 win.contentWindow.addEventListener('load', function(event) {
25 var windowParam;
26 if (mode == 'interactive')
27 windowParam = win;
28 win.contentWindow.loadAuthUrlAndShowWindow(url, windowParam);
29 });
30 });
33 chrome.identityPrivate.onWebFlowRequest.addListener(showAuthDialog);