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

Unified Diff: chrome/browser/resources/help/help.js

Issue 9618037: Help: Hook up the 'Get help' button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/help/help.js
diff --git a/chrome/browser/resources/help/help.js b/chrome/browser/resources/help/help.js
index 751eb417ef50a002a859287bc9bbfa1fe0074b38..565988aa56612c5d0cc18d03d8fec9e4fd2684d0 100644
--- a/chrome/browser/resources/help/help.js
+++ b/chrome/browser/resources/help/help.js
@@ -37,41 +37,29 @@ cr.define('help', function() {
var moreInfoOverlay = help.MoreInfoOverlay.getInstance();
moreInfoOverlay.initializePage();
- var self = this;
- var moreInfo = $('more-info');
- if (moreInfo) {
- moreInfo.onclick = function() {
- self.showOverlay_($('more-info-overlay'));
- };
- }
-
- var reportIssue = $('report-issue');
- if (reportIssue)
- reportIssue.onclick = this.reportAnIssue_.bind(this);
+ $('get-help').onclick = chrome.send.bind(chrome, 'openHelpPage');
+ $('report-issue').onclick =
+ chrome.send.bind(chrome, 'openFeedbackDialog');
- var promote = $('promote');
- if (promote) {
- promote.onclick = function() {
- chrome.send('promoteUpdater');
- };
- }
+ this.maybeSetOnClick_($('more-info'),
+ this.showOverlay_.bind(this, $('more-info-overlay')));
- var relaunch = $('relaunch');
- if (relaunch) {
- relaunch.onclick = function() {
- chrome.send('relaunchNow');
- };
- }
+ this.maybeSetOnClick_($('promote'),
+ chrome.send.bind(chrome, 'promoteUpdater'));
+ this.maybeSetOnClick_($('relaunch'),
+ chrome.send.bind(chrome, 'relaunchNow'));
// Attempt to update.
chrome.send('onPageLoaded');
},
/**
+ * Assigns |method| to the onclick property of |el| if |el| exists.
* @private
*/
- reportAnIssue_: function() {
- chrome.send('openFeedbackDialog');
+ maybeSetOnClick_: function(el, method) {
+ if (el)
+ el.onclick = method;
},
/**

Powered by Google App Engine
This is Rietveld 408576698