summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorjamiewalch <jamiewalch@chromium.org>2015-03-23 17:37:32 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-24 00:38:02 +0000
commitd0bb0dff1e0ac4c71dcd76caeadcbc32a23162ff (patch)
tree2d8773192b5c574ce221aa7bc0cda0c636be1279 /remoting
parent8d0ba1dfa407f78253c4c676b6e9f81baea2d69f (diff)
downloadchromium_src-d0bb0dff1e0ac4c71dcd76caeadcbc32a23162ff.zip
chromium_src-d0bb0dff1e0ac4c71dcd76caeadcbc32a23162ff.tar.gz
chromium_src-d0bb0dff1e0ac4c71dcd76caeadcbc32a23162ff.tar.bz2
Use a separate window to notify the user that permissions are required.
This also moves the in-DOM equivalent under crd/ since it's no longer cross-application. BUG=b/19484255 Review URL: https://codereview.chromium.org/1023943004 Cr-Commit-Position: refs/heads/master@{#321912}
Diffstat (limited to 'remoting')
-rw-r--r--remoting/app_remoting_webapp_files.gypi3
-rw-r--r--remoting/remoting_webapp_files.gypi4
-rw-r--r--remoting/webapp/app_remoting/html/template_lg.html2
-rw-r--r--remoting/webapp/app_remoting/js/app_remoting.js4
-rw-r--r--remoting/webapp/app_remoting/js/ar_auth_dialog.js56
-rw-r--r--remoting/webapp/crd/html/dialog_auth.html (renamed from remoting/webapp/base/html/dialog_auth.html)0
-rw-r--r--remoting/webapp/crd/html/template_main.html2
-rw-r--r--remoting/webapp/crd/js/crd_auth_dialog.js (renamed from remoting/webapp/base/js/auth_dialog.js)0
8 files changed, 62 insertions, 9 deletions
diff --git a/remoting/app_remoting_webapp_files.gypi b/remoting/app_remoting_webapp_files.gypi
index 5bea59a..69c8baf 100644
--- a/remoting/app_remoting_webapp_files.gypi
+++ b/remoting/app_remoting_webapp_files.gypi
@@ -40,7 +40,6 @@
'<(DEPTH)/remoting/webapp/app_remoting/html/template_lg.html',
'ar_main_template_files': [
'webapp/base/html/client_plugin.html',
- 'webapp/base/html/dialog_auth.html',
'webapp/app_remoting/html/context_menu.html',
'webapp/app_remoting/html/idle_dialog.html',
],
@@ -48,6 +47,7 @@
'webapp/app_remoting/js/application_context_menu.js',
'webapp/app_remoting/js/app_connected_view.js',
'webapp/app_remoting/js/app_remoting.js',
+ 'webapp/app_remoting/js/ar_auth_dialog.js',
'webapp/app_remoting/js/ar_main.js',
'webapp/app_remoting/js/context_menu_adapter.js',
'webapp/app_remoting/js/context_menu_chrome.js',
@@ -59,7 +59,6 @@
'webapp/app_remoting/js/submenu_manager.js',
'webapp/app_remoting/js/window_activation_menu.js',
'webapp/base/js/application.js',
- 'webapp/base/js/auth_dialog.js',
'webapp/base/js/base.js',
'webapp/base/js/message_window_helper.js',
'webapp/base/js/message_window_manager.js',
diff --git a/remoting/remoting_webapp_files.gypi b/remoting/remoting_webapp_files.gypi
index 189649f..6049516 100644
--- a/remoting/remoting_webapp_files.gypi
+++ b/remoting/remoting_webapp_files.gypi
@@ -130,7 +130,6 @@
],
# Auth (Google account) JavaScript files.
'remoting_webapp_js_auth_google_files': [
- 'webapp/base/js/auth_dialog.js',
'webapp/base/js/auth_init.js',
'webapp/crd/js/identity.js',
'webapp/crd/js/oauth2.js',
@@ -273,6 +272,7 @@
# The CRD-specific JavaScript files required by main.html.
'remoting_webapp_crd_main_html_all_js_files': [
'<@(remoting_webapp_shared_main_html_js_files)',
+ 'webapp/crd/js/crd_auth_dialog.js',
'webapp/crd/js/crd_connect.js',
'webapp/crd/js/crd_event_handlers.js',
'webapp/crd/js/crd_main.js',
@@ -284,8 +284,8 @@
# These template files are used to construct main.html.
'remoting_webapp_template_files': [
'webapp/base/html/client_plugin.html',
- 'webapp/base/html/dialog_auth.html',
'webapp/crd/html/butter_bar.html',
+ 'webapp/crd/html/dialog_auth.html',
'webapp/crd/html/dialog_client_connect_failed.html',
'webapp/crd/html/dialog_client_connecting.html',
'webapp/crd/html/dialog_client_host_needs_upgrade.html',
diff --git a/remoting/webapp/app_remoting/html/template_lg.html b/remoting/webapp/app_remoting/html/template_lg.html
index 32bb369..32c3a20 100644
--- a/remoting/webapp/app_remoting/html/template_lg.html
+++ b/remoting/webapp/app_remoting/html/template_lg.html
@@ -27,8 +27,6 @@ found in the LICENSE file.
<iframe id="wcs-sandbox" src="wcs_sandbox.html" hidden></iframe>
- <meta-include src="webapp/base/html/dialog_auth.html"/>
-
<div id="session-mode"
data-ui-mode="in-session home.client"
class="full-height"
diff --git a/remoting/webapp/app_remoting/js/app_remoting.js b/remoting/webapp/app_remoting/js/app_remoting.js
index b3fd07c..e8f3bbf 100644
--- a/remoting/webapp/app_remoting/js/app_remoting.js
+++ b/remoting/webapp/app_remoting/js/app_remoting.js
@@ -88,8 +88,6 @@ remoting.AppRemoting.prototype.init = function() {
this.contextMenu_ = new remoting.ApplicationContextMenu(adapter);
this.keyboardLayoutsMenu_ = new remoting.KeyboardLayoutsMenu(adapter);
this.windowActivationMenu_ = new remoting.WindowActivationMenu(adapter);
-
- remoting.LoadingWindow.show();
};
/**
@@ -102,6 +100,8 @@ remoting.AppRemoting.prototype.init = function() {
* start-up.
*/
remoting.AppRemoting.prototype.start = function(connector, token) {
+ remoting.LoadingWindow.show();
+
/** @type {remoting.AppRemoting} */
var that = this;
diff --git a/remoting/webapp/app_remoting/js/ar_auth_dialog.js b/remoting/webapp/app_remoting/js/ar_auth_dialog.js
new file mode 100644
index 0000000..3db64b0
--- /dev/null
+++ b/remoting/webapp/app_remoting/js/ar_auth_dialog.js
@@ -0,0 +1,56 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/** @suppress {duplicate} */
+var remoting = remoting || {};
+
+(function() {
+
+'use strict';
+
+var instance_ = null;
+
+/**
+ * @constructor
+ * @implements {remoting.Identity.ConsentDialog}
+ * @private
+ */
+remoting.AuthDialog = function() {
+ /** @private {base.Deferred} */
+ this.deferred_ = null;
+};
+
+/**
+ * @return {Promise} A Promise object that resolves when the user clicks on the
+ * auth button.
+ */
+remoting.AuthDialog.prototype.show = function() {
+ if (!this.deferred_) {
+ this.deferred_ = new base.Deferred();
+ remoting.MessageWindow.showMessageWindow(
+ l10n.getTranslationOrError(/*i18n-content*/'MODE_AUTHORIZE'),
+ l10n.getTranslationOrError(/*i18n-content*/'DESCRIPTION_AUTHORIZE'),
+ l10n.getTranslationOrError(/*i18n-content*/'CONTINUE_BUTTON'),
+ this.onOk_.bind(this));
+ }
+ return this.deferred_.promise();
+};
+
+/**
+ * @return {remoting.AuthDialog}
+ */
+remoting.AuthDialog.getInstance = function() {
+ if (!instance_) {
+ instance_ = new remoting.AuthDialog();
+ }
+ return instance_;
+};
+
+remoting.AuthDialog.prototype.onOk_ = function() {
+ base.debug.assert(this.deferred_ !== null);
+ this.deferred_.resolve();
+ this.deferred_ = null;
+};
+
+})();
diff --git a/remoting/webapp/base/html/dialog_auth.html b/remoting/webapp/crd/html/dialog_auth.html
index 209f1c8..209f1c8 100644
--- a/remoting/webapp/base/html/dialog_auth.html
+++ b/remoting/webapp/crd/html/dialog_auth.html
diff --git a/remoting/webapp/crd/html/template_main.html b/remoting/webapp/crd/html/template_main.html
index 6edc910..168755b 100644
--- a/remoting/webapp/crd/html/template_main.html
+++ b/remoting/webapp/crd/html/template_main.html
@@ -77,7 +77,7 @@ found in the LICENSE file.
</div> <!-- scroller -->
- <meta-include src="webapp/base/html/dialog_auth.html"/>
+ <meta-include src="webapp/crd/html/dialog_auth.html"/>
<div class="dialog-screen"
data-ui-mode="home.host home.client home.history home.confirm-host-delete home.host-setup home.token-refresh-failed home.manage-pairings home.host-setup home.host-install"
diff --git a/remoting/webapp/base/js/auth_dialog.js b/remoting/webapp/crd/js/crd_auth_dialog.js
index 6cde0e8..6cde0e8 100644
--- a/remoting/webapp/base/js/auth_dialog.js
+++ b/remoting/webapp/crd/js/crd_auth_dialog.js