| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Login UI header bar implementation. | 6 * @fileoverview Login UI header bar implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('login', function() { | 9 cr.define('login', function() { |
| 10 // Network state constants. | 10 // Network state constants. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 * been recieved. | 83 * been recieved. |
| 84 * @param {Integer} state Current state of the network (see NET_STATE). | 84 * @param {Integer} state Current state of the network (see NET_STATE). |
| 85 * @param {string} network Name of the network. | 85 * @param {string} network Name of the network. |
| 86 * @param {string} reason Reason the callback was called. | 86 * @param {string} reason Reason the callback was called. |
| 87 * @param {int} last Last active network type. | 87 * @param {int} last Last active network type. |
| 88 */ | 88 */ |
| 89 HeaderBar.handleAddUser = function(state, network, reason, last) { | 89 HeaderBar.handleAddUser = function(state, network, reason, last) { |
| 90 if (state != NET_STATE.OFFLINE) { | 90 if (state != NET_STATE.OFFLINE) { |
| 91 Oobe.showSigninUI(); | 91 Oobe.showSigninUI(); |
| 92 } else { | 92 } else { |
| 93 $('bubble').showTextForElement($('add-user-button'), | 93 $('bubble').showTextForElement( |
| 94 localStrings.getString('addUserErrorMessage')); | 94 $('add-user-button'), |
| 95 localStrings.getString('addUserErrorMessage'), |
| 96 cr.ui.Bubble.Attachment.BOTTOM); |
| 95 chrome.send('loginAddNetworkStateObserver', | 97 chrome.send('loginAddNetworkStateObserver', |
| 96 ['login.HeaderBar.bubbleWatchdog']); | 98 ['login.HeaderBar.bubbleWatchdog']); |
| 97 } | 99 } |
| 98 }; | 100 }; |
| 99 | 101 |
| 100 /** | 102 /** |
| 101 * Observes network state, and close the bubble when network becomes online. | 103 * Observes network state, and close the bubble when network becomes online. |
| 102 * @param {Integer} state Current state of the network (see NET_STATE). | 104 * @param {Integer} state Current state of the network (see NET_STATE). |
| 103 * @param {string} network Name of the network. | 105 * @param {string} network Name of the network. |
| 104 * @param {string} reason Reason the callback was called. | 106 * @param {string} reason Reason the callback was called. |
| 105 * @param {int} last Last active network type. | 107 * @param {int} last Last active network type. |
| 106 */ | 108 */ |
| 107 HeaderBar.bubbleWatchdog = function(state, network, reason, last) { | 109 HeaderBar.bubbleWatchdog = function(state, network, reason, last) { |
| 108 if (state != NET_STATE.OFFLINE) { | 110 if (state != NET_STATE.OFFLINE) { |
| 109 $('bubble').hideForElement($('add-user-button')); | 111 $('bubble').hideForElement($('add-user-button')); |
| 110 chrome.send('loginRemoveNetworkStateObserver', | 112 chrome.send('loginRemoveNetworkStateObserver', |
| 111 ['login.HeaderBar.bubbleWatchdog']); | 113 ['login.HeaderBar.bubbleWatchdog']); |
| 112 } | 114 } |
| 113 }; | 115 }; |
| 114 | 116 |
| 115 return { | 117 return { |
| 116 HeaderBar: HeaderBar | 118 HeaderBar: HeaderBar |
| 117 }; | 119 }; |
| 118 }); | 120 }); |
| OLD | NEW |