Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: chrome/browser/resources/settings/direction_delegate.js

Issue 2965643004: MD Settings: Convert remaining classes to ES6 syntax. (Closed)
Patch Set: Fix Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/direction_delegate.js
diff --git a/chrome/browser/resources/settings/direction_delegate.js b/chrome/browser/resources/settings/direction_delegate.js
index 3b8020a356269478006e2a68b8ee6948037c246e..6d5275337e9ad8270a2fcdc386bf880b9e769ead 100644
--- a/chrome/browser/resources/settings/direction_delegate.js
+++ b/chrome/browser/resources/settings/direction_delegate.js
@@ -4,26 +4,26 @@
cr.exportPath('settings');
-/** @interface */
-settings.DirectionDelegate = function() {};
+cr.define('settings', function() {
+ /** @interface */
+ class DirectionDelegate {
+ /**
+ * @return {boolean} Whether the direction of the settings UI is
+ * right-to-left.
+ */
+ isRtl() {}
+ }
-settings.DirectionDelegate.prototype = {
- /**
- * @return {boolean} Whether the direction of the settings UI is
- * right-to-left.
- */
- isRtl: assertNotReached,
-};
+ /** @implements {settings.DirectionDelegate} */
+ class DirectionDelegateImpl {
+ /** @override */
+ isRtl() {
+ return loadTimeData.getString('textdirection') == 'rtl';
+ }
+ }
-/**
- * @implements {settings.DirectionDelegate}
- * @constructor
- */
-settings.DirectionDelegateImpl = function() {};
-
-settings.DirectionDelegateImpl.prototype = {
- /** @override */
- isRtl: function() {
- return loadTimeData.getString('textdirection') == 'rtl';
- },
-};
+ return {
+ DirectionDelegate: DirectionDelegate,
+ DirectionDelegateImpl: DirectionDelegateImpl,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698