summaryrefslogtreecommitdiffstats
path: root/remoting/client
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-29 01:44:49 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-29 01:44:49 +0000
commit00a6a7d212295268c1884a41365659dfd01fc2b8 (patch)
treebec11efe5ac254cd31d8ace68aaf61141ad9d81d /remoting/client
parentf26df3468642bfcb592d527c1304e3f088bdf1ee (diff)
downloadchromium_src-00a6a7d212295268c1884a41365659dfd01fc2b8.zip
chromium_src-00a6a7d212295268c1884a41365659dfd01fc2b8.tar.gz
chromium_src-00a6a7d212295268c1884a41365659dfd01fc2b8.tar.bz2
Chromoting: JS code to display to hide login dialog
Extension JS code to display and hide login dialog. Also allow user to enter username and password. BUG=None TEST=none Review URL: http://codereview.chromium.org/6133005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r--remoting/client/extension/chromoting_tab.html7
-rw-r--r--remoting/client/extension/chromoting_tab.js17
-rw-r--r--remoting/client/extension/main.css13
3 files changed, 31 insertions, 6 deletions
diff --git a/remoting/client/extension/chromoting_tab.html b/remoting/client/extension/chromoting_tab.html
index 8a7d656..c24207e 100644
--- a/remoting/client/extension/chromoting_tab.html
+++ b/remoting/client/extension/chromoting_tab.html
@@ -13,6 +13,13 @@ found in the LICENSE file.
</head>
<body class="chromoting_body" onload="init();">
<div id="status_msg" class="status_msg"></div>
+ <div id="login_panel" class="login_panel">
+ <table>
+ <tr><td>Username:</td><td><input type="text" id="username" value="demo"/></td></tr>
+ <tr><td>Password:</td><td><input type="password" id="password" value="none" /></td></tr>
+ <tr><td colspan="2"><input type="button" value="Login" onclick="submitLogin();" /></td></tr>
+ </table>
+ </div>
<div id="plugin_div" class="plugin">
<embed width="100%" height="100%" name="chromoting" id="chromoting"
src="about://none" type="pepper-application/x-chromoting">
diff --git a/remoting/client/extension/chromoting_tab.js b/remoting/client/extension/chromoting_tab.js
index 1496846..d928313 100644
--- a/remoting/client/extension/chromoting_tab.js
+++ b/remoting/client/extension/chromoting_tab.js
@@ -15,6 +15,15 @@ function init() {
chrome.extension.onRequest.addListener(requestListener);
}
+function submitLogin() {
+ var username = document.getElementById("username").value;
+ var password = document.getElementById("password").value;
+
+ // Make the login panel invisible and submit login info.
+ document.getElementById("login_panel").className = "login_panel";
+ chromoting.plugin.submitLoginInfo(username, password);
+}
+
/**
* A listener function to be called when the extension fires a request.
*
@@ -58,12 +67,8 @@ function requestListener(request, sender, sendResponse) {
* password for logging into the remote host.
*/
function pluginLoginChallenge() {
- if (typeof chromoting.plugin.submitLoginInfo === 'function') {
- window.setTimeout("chromoting.plugin.submitLoginInfo('hello', 'world')",
- 100);
- } else {
- alert("Error calling methods in plugin.");
- }
+ // Make the login panel visible.
+ document.getElementById("login_panel").style.display = "block";
}
/**
diff --git a/remoting/client/extension/main.css b/remoting/client/extension/main.css
index 27b77ca..6b3ac1b 100644
--- a/remoting/client/extension/main.css
+++ b/remoting/client/extension/main.css
@@ -114,5 +114,18 @@ a.hostentry { text-decoration: none; }
font-weight: bold;
}
+.login_panel {
+ position: absolute;
+ display: none;
+ z-index: 1;
+ top: 50%;
+ left: 45%;
+ border-style: solid;
+ border-color: #D3D3D3 #808080;
+ margin-left: auto;
+ margin-right: auto;
+ width: 250px;
+}
+
.plugin {
}