Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: remoting/webapp/app_remoting/js/ar_auth_dialog.js

Issue 1023943004: Use a separate window to notify the user that permissions are required. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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.
4
5 /** @suppress {duplicate} */
6 var remoting = remoting || {};
7
8 (function() {
9
10 'use strict';
11
12 var instance_ = null;
13
14 /**
15 * @constructor
16 * @implements {remoting.Identity.ConsentDialog}
17 * @private
18 */
19 remoting.AuthDialog = function() {
20 /** @private {base.Deferred} */
21 this.deferred_ = null;
22 };
23
24 /**
25 * @return {Promise} A Promise object that resolves when the user clicks on the
26 * auth button.
27 */
28 remoting.AuthDialog.prototype.show = function() {
29 if (!this.deferred_) {
30 this.deferred_ = new base.Deferred();
31 remoting.MessageWindow.showMessageWindow(
32 l10n.getTranslationOrError(/*i18n-content*/'MODE_AUTHORIZE'),
33 l10n.getTranslationOrError(/*i18n-content*/'DESCRIPTION_AUTHORIZE'),
34 l10n.getTranslationOrError(/*i18n-content*/'CONTINUE_BUTTON'),
35 this.onOk_.bind(this));
36 }
37 return this.deferred_.promise();
38 };
39
40 /**
41 * @return {remoting.AuthDialog}
42 */
43 remoting.AuthDialog.getInstance = function() {
Jamie 2015/03/21 01:18:23 I would prefer that this getInstance() singleton i
garykac 2015/03/23 23:25:33 Add a TODO?
Jamie 2015/04/15 00:02:57 There's one in auth_init.js which I think applies.
44 if (!instance_) {
45 instance_ = new remoting.AuthDialog();
46 }
47 return instance_;
48 };
49
50 remoting.AuthDialog.prototype.onOk_ = function() {
51 base.debug.assert(this.deferred_ !== null);
52 this.deferred_.resolve();
53 this.deferred_ = null;
54 };
55
56 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698