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
3 // found in the LICENSE file.
7 var remoting = remoting || {};
10 * Show or hide the feedback button based on whether or not the current version
11 * of Chrome recognizes Chrome Remote Desktop as an authorized feedback source.
13 * @param {HTMLElement} helpIcon The parent <span> for the help icon and the
14 * <ul> containing the help and feedback entries.
15 * @param {HTMLElement} helpButton The Help <li> associated with the help icon.
16 * @param {HTMLElement} feedbackButton The Feedback <li> associated with the
20 remoting.Feedback = function(helpIcon, helpButton, feedbackButton) {
21 var menuButton = new remoting.MenuButton(helpIcon);
22 var showHelp = function() {
23 window.open('https://www.google.com/support/chrome/bin/answer.py?' +
26 helpButton.addEventListener('click', showHelp, false);
27 var chromeVersion = parseInt(
28 window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10);
29 if (chromeVersion >= 35) {
30 feedbackButton.addEventListener('click',
31 this.sendFeedback_.bind(this),
34 feedbackButton.hidden = true;
39 * Pass the current version of Chrome Remote Desktop to the Google Feedback
40 * extension and instruct it to show the feedback dialog.
42 remoting.Feedback.prototype.sendFeedback_ = function() {
44 requestFeedback: true,
48 { key: 'version', value: remoting.getExtensionInfo() }
52 var kFeedbackExtensionId = 'gfdkimpbcpahaombhbimeihdjnejgicl';
53 chrome.runtime.sendMessage(kFeedbackExtensionId, message, function() {});