Chromium Code Reviews| 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 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
| 6 <include src="extension_code.js"> | 6 <include src="extension_code.js"> |
| 7 <include src="extension_commands_overlay.js"> | 7 <include src="extension_commands_overlay.js"> |
| 8 <include src="extension_error_overlay.js"> | 8 <include src="extension_error_overlay.js"> |
| 9 <include src="extension_focus_manager.js"> | 9 <include src="extension_focus_manager.js"> |
| 10 <include src="extension_list.js"> | 10 <include src="extension_list.js"> |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 /** | 425 /** |
| 426 * Utility function to find the width of various UI strings and synchronize | 426 * Utility function to find the width of various UI strings and synchronize |
| 427 * the width of relevant spans. This is crucial for making sure the | 427 * the width of relevant spans. This is crucial for making sure the |
| 428 * Enable/Enabled checkboxes align, as well as the Developer Mode checkbox. | 428 * Enable/Enabled checkboxes align, as well as the Developer Mode checkbox. |
| 429 */ | 429 */ |
| 430 function measureCheckboxStrings() { | 430 function measureCheckboxStrings() { |
| 431 var trashWidth = 30; | 431 var trashWidth = 30; |
| 432 var measuringDiv = $('font-measuring-div'); | 432 var measuringDiv = $('font-measuring-div'); |
| 433 measuringDiv.textContent = | 433 measuringDiv.textContent = |
| 434 loadTimeData.getString('extensionSettingsEnabled'); | 434 loadTimeData.getString('extensionSettingsEnabled'); |
| 435 measuringDiv.className = 'enabled-text'; | |
| 435 var pxWidth = measuringDiv.clientWidth + trashWidth; | 436 var pxWidth = measuringDiv.clientWidth + trashWidth; |
| 436 measuringDiv.textContent = | 437 measuringDiv.textContent = |
| 437 loadTimeData.getString('extensionSettingsEnable'); | 438 loadTimeData.getString('extensionSettingsEnable'); |
| 439 measuringDiv.className = 'enable-text'; | |
|
Dan Beam
2014/09/08 22:47:11
nit: this looks like a typo because it's so simila
Evan Stade
2014/09/08 22:48:20
I suppose
| |
| 438 pxWidth = Math.max(measuringDiv.clientWidth + trashWidth, pxWidth); | 440 pxWidth = Math.max(measuringDiv.clientWidth + trashWidth, pxWidth); |
| 439 measuringDiv.textContent = | 441 measuringDiv.textContent = |
| 440 loadTimeData.getString('extensionSettingsDeveloperMode'); | 442 loadTimeData.getString('extensionSettingsDeveloperMode'); |
| 443 measuringDiv.className = ''; | |
| 441 pxWidth = Math.max(measuringDiv.clientWidth, pxWidth); | 444 pxWidth = Math.max(measuringDiv.clientWidth, pxWidth); |
| 442 | 445 |
| 443 var style = document.createElement('style'); | 446 var style = document.createElement('style'); |
| 444 style.type = 'text/css'; | 447 style.type = 'text/css'; |
| 445 style.textContent = | 448 style.textContent = |
| 446 '.enable-checkbox-text {' + | 449 '.enable-checkbox-text {' + |
| 447 ' min-width: ' + (pxWidth - trashWidth) + 'px;' + | 450 ' min-width: ' + (pxWidth - trashWidth) + 'px;' + |
| 448 '}' + | 451 '}' + |
| 449 '#dev-toggle span {' + | 452 '#dev-toggle span {' + |
| 450 ' min-width: ' + pxWidth + 'px;' + | 453 ' min-width: ' + pxWidth + 'px;' + |
| 451 '}'; | 454 '}'; |
| 452 document.querySelector('head').appendChild(style); | 455 document.querySelector('head').appendChild(style); |
| 453 }; | 456 }; |
| 454 | 457 |
| 455 // Export | 458 // Export |
| 456 return { | 459 return { |
| 457 ExtensionSettings: ExtensionSettings | 460 ExtensionSettings: ExtensionSettings |
| 458 }; | 461 }; |
| 459 }); | 462 }); |
| 460 | 463 |
| 461 window.addEventListener('load', function(e) { | 464 window.addEventListener('load', function(e) { |
| 462 extensions.ExtensionSettings.getInstance().initialize(); | 465 extensions.ExtensionSettings.getInstance().initialize(); |
| 463 }); | 466 }); |
| OLD | NEW |