| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.exportPath('settings'); | 5 cr.exportPath('settings'); |
| 6 | 6 |
| 7 /** @interface */ | 7 cr.define('settings', function() { |
| 8 settings.DirectionDelegate = function() {}; | 8 /** @interface */ |
| 9 class DirectionDelegate { |
| 10 /** |
| 11 * @return {boolean} Whether the direction of the settings UI is |
| 12 * right-to-left. |
| 13 */ |
| 14 isRtl() {} |
| 15 } |
| 9 | 16 |
| 10 settings.DirectionDelegate.prototype = { | 17 /** @implements {settings.DirectionDelegate} */ |
| 11 /** | 18 class DirectionDelegateImpl { |
| 12 * @return {boolean} Whether the direction of the settings UI is | 19 /** @override */ |
| 13 * right-to-left. | 20 isRtl() { |
| 14 */ | 21 return loadTimeData.getString('textdirection') == 'rtl'; |
| 15 isRtl: assertNotReached, | 22 } |
| 16 }; | 23 } |
| 17 | 24 |
| 18 /** | 25 return { |
| 19 * @implements {settings.DirectionDelegate} | 26 DirectionDelegate: DirectionDelegate, |
| 20 * @constructor | 27 DirectionDelegateImpl: DirectionDelegateImpl, |
| 21 */ | 28 }; |
| 22 settings.DirectionDelegateImpl = function() {}; | 29 }); |
| 23 | |
| 24 settings.DirectionDelegateImpl.prototype = { | |
| 25 /** @override */ | |
| 26 isRtl: function() { | |
| 27 return loadTimeData.getString('textdirection') == 'rtl'; | |
| 28 }, | |
| 29 }; | |
| OLD | NEW |