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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 | 9 |
10 // | 10 // |
(...skipping 24 matching lines...) Expand all Loading... | |
35 * |onShowHomeButtonChanged_|. | 35 * |onShowHomeButtonChanged_|. |
36 * @type {boolean} | 36 * @type {boolean} |
37 * @private | 37 * @private |
38 */ | 38 */ |
39 onShowHomeButtonChangedCalled_: false, | 39 onShowHomeButtonChangedCalled_: false, |
40 | 40 |
41 /** | 41 /** |
42 * Track if page initialization is complete. All C++ UI handlers have the | 42 * Track if page initialization is complete. All C++ UI handlers have the |
43 * chance to manipulate page content within their InitializePage methods. | 43 * chance to manipulate page content within their InitializePage methods. |
44 * This flag is set to true after all initializers have been called. | 44 * This flag is set to true after all initializers have been called. |
45 * @type (boolean} | 45 * @type {boolean} |
46 * @private | 46 * @private |
47 */ | 47 */ |
48 initializationComplete_: false, | 48 initializationComplete_: false, |
49 | 49 |
50 /** @override */ | 50 /** @override */ |
51 initializePage: function() { | 51 initializePage: function() { |
52 OptionsPage.prototype.initializePage.call(this); | 52 OptionsPage.prototype.initializePage.call(this); |
53 var self = this; | 53 var self = this; |
54 | 54 |
55 // Ensure that navigation events are unblocked on uber page. A reload of | 55 // Ensure that navigation events are unblocked on uber page. A reload of |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
460 if (cr.isChromeOS) { | 460 if (cr.isChromeOS) { |
461 if (loadTimeData.getBoolean('enableKioskSection')) { | 461 if (loadTimeData.getBoolean('enableKioskSection')) { |
462 $('kiosk-section').hidden = false; | 462 $('kiosk-section').hidden = false; |
463 | 463 |
464 $('manage-kiosk-apps-button').onclick = function(event) { | 464 $('manage-kiosk-apps-button').onclick = function(event) { |
465 OptionsPage.navigateToPage('kioskAppsOverlay'); | 465 OptionsPage.navigateToPage('kioskAppsOverlay'); |
466 }; | 466 }; |
467 } | 467 } |
468 } | 468 } |
469 | 469 |
470 // System section. | |
471 if (!cr.isChromeOS) { | |
472 var updateGpuRestartButton = function() { | |
473 $('gpu-mode-reset-restart').hidden = | |
474 loadTimeData.getBoolean('gpuEnabledAtStart') == | |
475 $('gpu-mode-checkbox').checked; | |
476 } | |
Dan Beam
2013/03/22 22:44:04
};
Zhenyao Mo
2013/03/22 23:13:00
Done.
| |
477 Preferences.getInstance().addEventListener( | |
478 'hardware_acceleration_mode.enabled', | |
Dan Beam
2013/03/22 22:44:04
can you use
$('gpu-mode-checkbox').getAttribute
Zhenyao Mo
2013/03/22 23:13:00
Done.
| |
479 updateGpuRestartButton); | |
480 $('gpu-mode-reset-restart-button').onclick = function(event) { | |
481 chrome.send('restartBrowser'); | |
482 }; | |
483 updateGpuRestartButton(); | |
484 } | |
485 | |
470 if (loadTimeData.getBoolean('managedUsersEnabled') && | 486 if (loadTimeData.getBoolean('managedUsersEnabled') && |
471 loadTimeData.getBoolean('profileIsManaged')) { | 487 loadTimeData.getBoolean('profileIsManaged')) { |
472 $('managed-user-settings-section').hidden = false; | 488 $('managed-user-settings-section').hidden = false; |
473 | 489 |
474 $('open-managed-user-settings-button').onclick = function(event) { | 490 $('open-managed-user-settings-button').onclick = function(event) { |
475 OptionsPage.navigateToPage('managedUser'); | 491 OptionsPage.navigateToPage('managedUser'); |
476 }; | 492 }; |
477 } | 493 } |
478 }, | 494 }, |
479 | 495 |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1379 removeBluetoothDevice_: function(address) { | 1395 removeBluetoothDevice_: function(address) { |
1380 var index = $('bluetooth-unpaired-devices-list').find(address); | 1396 var index = $('bluetooth-unpaired-devices-list').find(address); |
1381 if (index != undefined) { | 1397 if (index != undefined) { |
1382 $('bluetooth-unpaired-devices-list').deleteItemAtIndex(index); | 1398 $('bluetooth-unpaired-devices-list').deleteItemAtIndex(index); |
1383 } else { | 1399 } else { |
1384 index = $('bluetooth-paired-devices-list').find(address); | 1400 index = $('bluetooth-paired-devices-list').find(address); |
1385 if (index != undefined) | 1401 if (index != undefined) |
1386 $('bluetooth-paired-devices-list').deleteItemAtIndex(index); | 1402 $('bluetooth-paired-devices-list').deleteItemAtIndex(index); |
1387 } | 1403 } |
1388 } | 1404 } |
1405 | |
1389 }; | 1406 }; |
1390 | 1407 |
1391 //Forward public APIs to private implementations. | 1408 //Forward public APIs to private implementations. |
1392 [ | 1409 [ |
1393 'addBluetoothDevice', | 1410 'addBluetoothDevice', |
1394 'enableFactoryResetSection', | 1411 'enableFactoryResetSection', |
1395 'getCurrentProfile', | 1412 'getCurrentProfile', |
1396 'getStartStopSyncButton', | 1413 'getStartStopSyncButton', |
1397 'hideBluetoothSettings', | 1414 'hideBluetoothSettings', |
1398 'notifyInitializationComplete', | 1415 'notifyInitializationComplete', |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1440 BrowserOptions.getLoggedInUsername = function() { | 1457 BrowserOptions.getLoggedInUsername = function() { |
1441 return BrowserOptions.getInstance().username_; | 1458 return BrowserOptions.getInstance().username_; |
1442 }; | 1459 }; |
1443 } | 1460 } |
1444 | 1461 |
1445 // Export | 1462 // Export |
1446 return { | 1463 return { |
1447 BrowserOptions: BrowserOptions | 1464 BrowserOptions: BrowserOptions |
1448 }; | 1465 }; |
1449 }); | 1466 }); |
OLD | NEW |