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

Unified Diff: remoting/webapp/crd/js/local_host_section.js

Issue 978863002: Better UI when the machine is shared under a different account (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/crd/html/ui_me2me.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/local_host_section.js
diff --git a/remoting/webapp/crd/js/local_host_section.js b/remoting/webapp/crd/js/local_host_section.js
index fc733c2dbdf647639e20004a661c8a46d371b0d2..50bebe7cf0420732084034244565d0af5614b3b6 100644
--- a/remoting/webapp/crd/js/local_host_section.js
+++ b/remoting/webapp/crd/js/local_host_section.js
@@ -36,6 +36,7 @@ remoting.LocalHostSection = function(rootElement, controller) {
var startButton = rootElement.querySelector('.start-daemon');
var stopButton = rootElement.querySelector('.stop-daemon');
+ var stopLocalDaemonButton = rootElement.querySelector('.stop-local-daemon');
var changePINButton = rootElement.querySelector('.change-daemon-pin');
/** @private */
@@ -44,6 +45,8 @@ remoting.LocalHostSection = function(rootElement, controller) {
controller.start.bind(controller), false),
new base.DomEventHook(stopButton, 'click',
controller.stop.bind(controller), false),
+ new base.DomEventHook(stopLocalDaemonButton, 'click',
+ controller.stop.bind(controller), false),
new base.DomEventHook(changePINButton, 'click',
controller.changePIN.bind(controller), false));
/** @private */
@@ -111,7 +114,15 @@ remoting.LocalHostSection.prototype.updateUI_ = function() {
// Disable elements.
var enabled = this.isEnabled_();
var canChangeLocalHostState = this.canChangeState();
- remoting.updateModalUi(enabled ? 'enabled' : 'disabled', 'data-daemon-state');
+ var daemonState = '';
+ if (!enabled) {
+ daemonState = 'disabled';
+ } else if (this.host_ !== null) {
+ daemonState = 'enabled';
+ } else {
+ daemonState = 'enabled-other-account';
+ }
+ remoting.updateModalUi(daemonState, 'data-daemon-state');
this.rootElement_.hidden = !canChangeLocalHostState;
};
« no previous file with comments | « remoting/webapp/crd/html/ui_me2me.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698