| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 Network drop-down implementation. | 6 * @fileoverview Network drop-down implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('cr.ui', function() { | 9 cr.define('cr.ui', function() { |
| 10 /** | 10 /** |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 DropDown.updateNetworkTitle = function(title, icon) { | 366 DropDown.updateNetworkTitle = function(title, icon) { |
| 367 var elementId = DropDown.activeElementId_; | 367 var elementId = DropDown.activeElementId_; |
| 368 $(elementId).setTitle(title, icon); | 368 $(elementId).setTitle(title, icon); |
| 369 }; | 369 }; |
| 370 | 370 |
| 371 /** | 371 /** |
| 372 * Activates or deactivates network drop-down. Only one network drop-down | 372 * Activates or deactivates network drop-down. Only one network drop-down |
| 373 * can be active at the same time. So activating new drop-down deactivates | 373 * can be active at the same time. So activating new drop-down deactivates |
| 374 * the previous one. Deactivating not active drop-down does nothing. | 374 * the previous one. Deactivating not active drop-down does nothing. |
| 375 * @param {string} element_id Id of the element which is network drop-down. | 375 * @param {string} element_id Id of the element which is network drop-down. |
| 376 * @param {boolean} is_active Is drop-down active? | 376 * @param {boolean} isActive Is drop-down active? |
| 377 * @param {boolean} isOobe Is dropdown placed on an OOBE screen. |
| 377 */ | 378 */ |
| 378 DropDown.setActive = function(elementId, isActive) { | 379 DropDown.setActive = function(elementId, isActive, isOobe) { |
| 379 if (isActive) { | 380 if (isActive) { |
| 380 DropDown.activeElementId_ = elementId; | 381 DropDown.activeElementId_ = elementId; |
| 381 $(elementId).isShown = false; | 382 $(elementId).isShown = false; |
| 382 chrome.send('networkDropdownShow', [elementId]); | 383 chrome.send('networkDropdownShow', [elementId, isOobe]); |
| 383 } else { | 384 } else { |
| 384 if (DropDown.activeElementId_ == elementId) { | 385 if (DropDown.activeElementId_ == elementId) { |
| 385 DropDown.activeElementId_ = ''; | 386 DropDown.activeElementId_ = ''; |
| 386 chrome.send('networkDropdownHide', []); | 387 chrome.send('networkDropdownHide', []); |
| 387 } | 388 } |
| 388 } | 389 } |
| 389 }; | 390 }; |
| 390 | 391 |
| 391 /** | 392 /** |
| 392 * Refreshes network drop-down. Should be called on language change. | 393 * Refreshes network drop-down. Should be called on language change. |
| 393 */ | 394 */ |
| 394 DropDown.refresh = function() { | 395 DropDown.refresh = function() { |
| 395 chrome.send('networkDropdownRefresh', []); | 396 chrome.send('networkDropdownRefresh', []); |
| 396 }; | 397 }; |
| 397 | 398 |
| 398 return { | 399 return { |
| 399 DropDown: DropDown | 400 DropDown: DropDown |
| 400 }; | 401 }; |
| 401 }); | 402 }); |
| OLD | NEW |