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

Unified Diff: chrome/browser/resources/chromeos/login/screen_error_message.js

Issue 8681029: [cros] Make disconnected icons used by network drop-down and network button consistent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 9 years, 1 month 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
Index: chrome/browser/resources/chromeos/login/screen_error_message.js
diff --git a/chrome/browser/resources/chromeos/login/screen_error_message.js b/chrome/browser/resources/chromeos/login/screen_error_message.js
index 2a3374312f3d411a76bbe8f819f0a319c43abab3..83d15a4eface35590292b0f089d99c05520de2d7 100644
--- a/chrome/browser/resources/chromeos/login/screen_error_message.js
+++ b/chrome/browser/resources/chromeos/login/screen_error_message.js
@@ -67,23 +67,6 @@ cr.define('login', function() {
this.updateLocalizedContent_();
},
- onBeforeShow: function() {
- cr.ui.DropDown.setActive('offline-networks-list', true, false);
-
- $('error-guest-signin').hidden = $('guestSignin').hidden ||
- !$('add-user-header-bar-item').hidden;
- },
-
- onBeforeHide: function() {
- cr.ui.DropDown.setActive('offline-networks-list', false, false);
- },
-
- update: function() {
- chrome.send('loginRequestNetworkState',
- ['login.ErrorMessageScreen.updateState',
- 'update']);
- },
-
/**
* Updates localized content of the screen that is not updated via template.
*/
@@ -117,10 +100,31 @@ cr.define('login', function() {
};
},
+ onBeforeShow: function(lastNetworkType) {
+ cr.ui.DropDown.show('offline-networks-list', false, lastNetworkType);
+
+ $('error-guest-signin').hidden = $('guestSignin').hidden ||
+ !$('add-user-header-bar-item').hidden;
+ },
+
+ onBeforeHide: function() {
+ cr.ui.DropDown.hide('offline-networks-list');
+ },
+
+ update: function() {
+ chrome.send('loginRequestNetworkState',
+ ['login.ErrorMessageScreen.updateState',
+ 'update']);
+ },
+
/**
* Shows or hides offline message based on network on/offline state.
+ * @param {Integer} state Current state of the network (see NET_STATE).
+ * @param {string} network Name of the current network.
+ * @param {string} reason Reason the callback was called.
+ * @param {int} lastNetworkType Last active network type.
*/
- updateState_: function(state, network, reason) {
+ updateState_: function(state, network, reason, lastNetworkType) {
var currentScreen = Oobe.getInstance().currentScreen;
var offlineMessage = this;
var isOnline = (state == NET_STATE.ONLINE);
@@ -141,7 +145,7 @@ cr.define('login', function() {
console.log('Show offline message, state=' + state +
', network=' + network +
', isUnderCaptivePortal=' + isUnderCaptivePortal);
- offlineMessage.onBeforeShow();
+ offlineMessage.onBeforeShow(lastNetworkType);
if (isUnderCaptivePortal) {
if (isProxyError) {
@@ -197,9 +201,11 @@ cr.define('login', function() {
* @param {Integer} state Current state of the network (see NET_STATE).
* @param {string} network Name of the current network.
* @param {string} reason Reason the callback was called.
+ * @param {int} lastNetworkType Last active network type.
*/
- ErrorMessageScreen.updateState = function(state, network, reason) {
- $('error-message').updateState_(state, network, reason);
+ ErrorMessageScreen.updateState = function(
+ state, network, reason, lastNetworkType) {
+ $('error-message').updateState_(state, network, reason, lastNetworkType);
};
/**

Powered by Google App Engine
This is Rietveld 408576698