summaryrefslogtreecommitdiffstats
path: root/remoting/webapp
diff options
context:
space:
mode:
authorgarykac <garykac@chromium.org>2015-03-03 17:29:27 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-04 01:30:14 +0000
commit2f51134af40b596569eb0542727db995e6b07369 (patch)
tree3544b15e70ac6ae08cd47a84635bd1f0b5ae0c64 /remoting/webapp
parentc52617fee2c9268d7ee3ce7d0cc90e4c80618483 (diff)
downloadchromium_src-2f51134af40b596569eb0542727db995e6b07369.zip
chromium_src-2f51134af40b596569eb0542727db995e6b07369.tar.gz
chromium_src-2f51134af40b596569eb0542727db995e6b07369.tar.bz2
[Chromoting] Remove hangout consent dialog.
We're updating our build to ensure that all html files are auto generated and jscompiled. This html file is being removed now (rather than updated to be jscompiled) because we intend to remove the It2MeHelpeeChannel code in the near future. BUG= Review URL: https://codereview.chromium.org/979483002 Cr-Commit-Position: refs/heads/master@{#318992}
Diffstat (limited to 'remoting/webapp')
-rw-r--r--remoting/webapp/crd/html/dialog_hangout_consent.css103
-rw-r--r--remoting/webapp/crd/html/dialog_hangout_consent.html36
-rw-r--r--remoting/webapp/crd/js/hangout_consent_dialog.js105
-rw-r--r--remoting/webapp/crd/js/hangout_consent_dialog_main.js63
-rw-r--r--remoting/webapp/crd/js/it2me_helpee_channel.js7
-rw-r--r--remoting/webapp/unittests/it2me_helpee_channel_unittest.js5
6 files changed, 1 insertions, 318 deletions
diff --git a/remoting/webapp/crd/html/dialog_hangout_consent.css b/remoting/webapp/crd/html/dialog_hangout_consent.css
deleted file mode 100644
index 7bd4378..0000000
--- a/remoting/webapp/crd/html/dialog_hangout_consent.css
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Copyright 2014 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.
- */
-
-html, div, span, body, ul, li {
- border: 0;
- margin: 0;
- padding: 0;
- font-family: "Arial", "Helvetica", sans-serif;
- font-weight: normal;
- /* Allows the user to move the window by dragging its content. */
- -webkit-app-region: drag;
-}
-
-.header {
- height: 46px;
- background: #1c91c0;
- padding: 15px;
-}
-
-.header .title {
- color: white;
- float: left;
- font-size: 24px;
- line-height: 46px;
- padding-left: 15px;
-}
-
-.header .logo {
- float: left;
- height: 46px;
- width: 46px;
- background: url('chromoting48.webp');
-}
-
-.content {
- text-align: center;
- margin: auto;
- width: 70%;
-}
-
-.content .message {
- padding: 30px;
- font-size: 20px;
-}
-
-.content ul {
- list-style: none;
- border-width: 0px 0px 1px 0px;
- border-style: solid;
- border-color: #f0f0f0;
-}
-
-.content li {
- border-width: 1px 0px 0px 0px;
- border-style: solid;
- border-color: #f0f0f0;
- padding: 15px;
- text-align: left;
- font-size: 14px;
-}
-
-.button {
- padding: 0px 20px;
- border: 1px solid #f0f0f0;
- border-radius: 5px;
- font-size: 14px;
- font-weight: bold;
- line-height: 36px;
- color: #737373;
- -webkit-app-region: no-drag;
-}
-
-.footer {
- padding-top: 30px;
- padding-bottom: 30px;
- /* Clear the float of its children. */
- overflow: auto;
- width: 100%
-}
-
-.button.default {
- background: #427fed;
- color: white;
-}
-
-.button:hover {
- border-color: #cecece;
-}
-
-.button.default:active {
- background: #2c56b1;
-}
-
-.ok-button {
- float: right;
- margin-left: 10px;
-}
-
-.cancel-button {
- float: right;
-}
diff --git a/remoting/webapp/crd/html/dialog_hangout_consent.html b/remoting/webapp/crd/html/dialog_hangout_consent.html
deleted file mode 100644
index 3ad7ebd..0000000
--- a/remoting/webapp/crd/html/dialog_hangout_consent.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!doctype html>
-<!--
-Copyright 2014 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.
--->
-
-<html>
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" href="dialog_hangout_consent.css">
- <script type="text/javascript" src="base.js"></script>
- <script type="text/javascript" src="hangout_consent_dialog_main.js"></script>
- <script type="text/javascript" src="ipc.js"></script>
- <script type="text/javascript" src="l10n.js"></script>
- <script type="text/javascript" src="typecheck.js"></script>
- </head>
- <body>
- <div class="header">
- <div class="logo"></div>
- <div class="title" i18n-content="MODE_IT2ME"></div>
- </div>
- <div class="content">
- <div class="message" i18n-content="HANGOUTS_CONFIRM_DIALOG_MESSAGE_1"></div>
- <ul>
- <li i18n-content="HANGOUTS_CONFIRM_DIALOG_MESSAGE_2"></li>
- <li i18n-content="HANGOUTS_CONFIRM_DIALOG_MESSAGE_3"></li>
- <li i18n-content="DESCRIPTION_AUTHORIZE" class='auth-message'></li>
- </ul>
- <div class="footer">
- <div class="button default ok-button" i18n-content="HANGOUTS_CONFIRM_DIALOG_ACCEPT"></div>
- <div class="button cancel-button" i18n-content="HANGOUTS_CONFIRM_DIALOG_DECLINE"></div>
- </div>
- </div>
- </body>
-</html>
diff --git a/remoting/webapp/crd/js/hangout_consent_dialog.js b/remoting/webapp/crd/js/hangout_consent_dialog.js
deleted file mode 100644
index 648419e..0000000
--- a/remoting/webapp/crd/js/hangout_consent_dialog.js
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2014 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;
-
-/**
- * Shows a dialog to ask for the user's permission to accept remote assistance
- * from a Hangout participant.
- *
- * @constructor
- * @private
- */
-remoting.HangoutConsentDialog = function() {
- /**
- * @type {base.Deferred}
- * @private
- */
- this.onConsentResponseDeferred_ = null;
-
- /** @private */
- this.requestToken_ = base.generateXsrfToken();
-
- base.Ipc.getInstance().register('remoting.HangoutConsentDialog.confirm',
- this.onConfirmResponse_.bind(this));
-};
-
-/**
- * @param {boolean} confirm Whether the user authorized the it2me connection
- * @param {string} responseToken
- * @private
- */
-remoting.HangoutConsentDialog.prototype.onConfirmResponse_ = function(
- confirm, responseToken) {
- if (responseToken !== this.requestToken_) {
- return;
- }
-
- if (confirm) {
- this.onConsentResponseDeferred_.resolve();
- } else {
- this.onConsentResponseDeferred_.reject(
- new Error(remoting.Error.CANCELLED));
- }
- this.onConsentResponseDeferred_ = null;
-};
-
-/**
- * @param {boolean} authorized If true, the consent dialog will hide the
- * authorization section.
- * @param {Bounds=} opt_parentBounds If present, the consent dialog will be
- * centered within |opt_parentBounds|.
- * @return {Promise} A Promise that will resolve when permission is granted or
- * reject if the user cancels.
- */
-remoting.HangoutConsentDialog.prototype.show = function(authorized,
- opt_parentBounds) {
- if (!this.onConsentResponseDeferred_) {
- var DIALOG_WIDTH = 750;
- var DIALOG_HEIGHT = 480;
-
- var createOptions = {
- frame: 'none',
- resizable: false,
- outerBounds: { width: DIALOG_WIDTH, height: DIALOG_HEIGHT }
- };
-
- var params = {
- token: this.requestToken_,
- authorized: Boolean(authorized)
- };
-
- var url = base.urlJoin('dialog_hangout_consent.html', params);
-
- if (opt_parentBounds) {
- // Center the dialog on the parent bounds.
- var rect = opt_parentBounds;
- createOptions.outerBounds.top =
- Math.round(rect.top + rect.height / 2 - DIALOG_HEIGHT / 2);
- createOptions.outerBounds.left =
- Math.round(rect.left + rect.width / 2 - DIALOG_WIDTH / 2);
- }
-
- this.onConsentResponseDeferred_ = new base.Deferred();
- chrome.app.window.create(url, createOptions);
- }
- return this.onConsentResponseDeferred_.promise();
-};
-
-/** @return {remoting.HangoutConsentDialog} */
-remoting.HangoutConsentDialog.getInstance = function() {
- if (!instance_) {
- instance_ = new remoting.HangoutConsentDialog();
- }
- return instance_;
-};
-
-}());
diff --git a/remoting/webapp/crd/js/hangout_consent_dialog_main.js b/remoting/webapp/crd/js/hangout_consent_dialog_main.js
deleted file mode 100644
index 8ced7a8..0000000
--- a/remoting/webapp/crd/js/hangout_consent_dialog_main.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2014 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.
-
-/**
-* @fileoverview
-* The entry point for dialog_hangout_consent.html.
-*/
-
-
-/** @suppress {duplicate} */
-var remoting = remoting || {};
-
-(function() {
-
-'use strict';
-
-/**
- * @constructor
- * @param {HTMLElement} rootElement
- * @param {string} requestToken
- * @param {boolean} authorized Whether the user is authorized or not.
- */
-var ConsentDialog = function(rootElement, requestToken, authorized) {
- /** @private */
- this.okButton_ = rootElement.querySelector('.ok-button');
- /** @private */
- this.cancelButton_ = rootElement.querySelector('.cancel-button');
- /** @private */
- this.authSection_ = rootElement.querySelector('.auth-message');
- /** @private */
- this.requestToken_ = requestToken;
-
- if (authorized) {
- this.authSection_.hidden = true;
- }
-
- this.okButton_.addEventListener('click', this.onButton_.bind(this, true));
- this.cancelButton_.addEventListener('click',this.onButton_.bind(this, false));
- base.resizeWindowToContent();
-};
-
-/**
- * @param {boolean} confirm
- * @private
- */
-ConsentDialog.prototype.onButton_ = function(confirm) {
- base.Ipc.invoke('remoting.HangoutConsentDialog.confirm', confirm,
- this.requestToken_);
- chrome.app.window.current().close();
-};
-
-function onDomContentLoaded() {
- var params = base.getUrlParameters();
- var authorized = getBooleanAttr(params, 'authorized', false);
- var token = getStringAttr(params, 'token');
- l10n.localize();
- var confirmDialog = new ConsentDialog(document.body, token, authorized);
-}
-
-window.addEventListener('load', onDomContentLoaded);
-
-}());
diff --git a/remoting/webapp/crd/js/it2me_helpee_channel.js b/remoting/webapp/crd/js/it2me_helpee_channel.js
index 79c016b..bea9b6d 100644
--- a/remoting/webapp/crd/js/it2me_helpee_channel.js
+++ b/remoting/webapp/crd/js/it2me_helpee_channel.js
@@ -323,12 +323,7 @@ remoting.It2MeHelpeeChannel.prototype.showConfirmDialogV2_ = function(bounds) {
var getToken =
base.Promise.as(chrome.identity.getAuthToken, [{interactive: false}]);
- return getToken.then(
- /** @param {string} token */
- function(token) {
- return remoting.HangoutConsentDialog.getInstance().show(Boolean(token),
- bounds);
- });
+ return getToken;
};
/**
diff --git a/remoting/webapp/unittests/it2me_helpee_channel_unittest.js b/remoting/webapp/unittests/it2me_helpee_channel_unittest.js
index 30d060d..2ba41e9 100644
--- a/remoting/webapp/unittests/it2me_helpee_channel_unittest.js
+++ b/remoting/webapp/unittests/it2me_helpee_channel_unittest.js
@@ -126,11 +126,6 @@ QUnit.asyncTest('connect() should return access code',
function() {
// Stubs authentication.
sinon.stub(base, 'isAppsV2').returns(true);
- sinon.stub(remoting.HangoutConsentDialog, 'getInstance').returns({
- show : function() {
- return Promise.resolve();
- }
- });
sinon.stub(chrome.identity, 'getAuthToken')
.callsArgWith(1, 'token');
sinon.stub(remoting.identity, 'getToken')