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

Unified Diff: chrome/browser/resources/options/browser_options.js

Issue 557633002: Add public API generation with cr.makePublic() and handle it in compiler pass (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@H_options_errors_3
Patch Set: remove fake declarations Created 6 years, 3 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/options/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index c67ef9011adaf3031f373bbea03ce54d4a0bcd07..3f15a0a33590afcd2efe83aa605232a99f8b94b8 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -17,10 +17,11 @@ cr.define('options', function() {
DEFAULT: 1
};
- //
- // BrowserOptions class
- // Encapsulated handling of browser options page.
- //
+ /**
+ * Encapsulated handling of browser options page.
+ * @constructor
+ * @extends {cr.ui.pageManager.Page}
+ */
function BrowserOptions() {
Page.call(this, 'settings', loadTimeData.getString('settingsTitle'),
'settings');
@@ -1411,16 +1412,25 @@ cr.define('options', function() {
ManageProfileOverlay.showDeleteDialog(this.getCurrentProfile_());
},
+ /**
+ * @param {boolean} enabled
+ */
setNativeThemeButtonEnabled_: function(enabled) {
var button = $('themes-native-button');
if (button)
button.disabled = !enabled;
},
+ /**
+ * @param {boolean} enabled
+ */
setThemesResetButtonEnabled_: function(enabled) {
$('themes-reset').disabled = !enabled;
},
+ /**
+ * @param {boolean} managed
+ */
setAccountPictureManaged_: function(managed) {
var picture = $('account-picture');
if (managed || UIAccountTweaks.loggedInAsGuest()) {
@@ -1452,6 +1462,9 @@ cr.define('options', function() {
}
},
+ /**
+ * @param {boolean} managed
+ */
setWallpaperManaged_: function(managed) {
var button = $('set-wallpaper');
button.disabled = !!managed;
@@ -1896,7 +1909,7 @@ cr.define('options', function() {
};
//Forward public APIs to private implementations.
- [
+ cr.makePublic(BrowserOptions, [
'addBluetoothDevice',
'deleteCurrentProfile',
'enableCertificateButton',
@@ -1941,14 +1954,8 @@ cr.define('options', function() {
'updateEasyUnlock',
'updateManagesSupervisedUsers',
'updateSearchEngines',
- 'updateStartupPages',
'updateSyncState',
- ].forEach(function(name) {
- BrowserOptions[name] = function() {
- var instance = BrowserOptions.getInstance();
- return instance[name + '_'].apply(instance, arguments);
- };
- });
+ ]);
if (cr.isChromeOS) {
/**

Powered by Google App Engine
This is Rietveld 408576698