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 * Attach appropriate event handlers and show or hide the feedback button based
11 * on whether or not the current version of Chrome recognizes Chrome Remote
12 * Desktop as an authorized feedback source.
14 * @param {HTMLElement} container The menu containing the help and feedback
17 remoting.manageHelpAndFeedback = function(container) {
18 var showHelp = function() {
19 window.open('https://support.google.com/chrome/answer/1649523');
21 var helpButton = container.querySelector('.menu-help');
22 base.debug.assert(helpButton != null);
23 helpButton.addEventListener('click', showHelp, false);
24 var feedbackButton = container.querySelector('.menu-feedback');
25 base.debug.assert(feedbackButton != null);
26 var chromeVersion = parseInt(
27 window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10);
28 if (chromeVersion >= 35) {
29 feedbackButton.addEventListener('click',
30 remoting.sendFeedback_,
33 feedbackButton.hidden = true;
38 * Pass the current version of Chrome Remote Desktop to the Google Feedback
39 * extension and instruct it to show the feedback dialog.
41 remoting.sendFeedback_ = function() {
43 requestFeedback: true,
47 { key: 'version', value: remoting.app.getExtensionInfo() }
51 var kFeedbackExtensionId = 'gfdkimpbcpahaombhbimeihdjnejgicl';
52 chrome.runtime.sendMessage(kFeedbackExtensionId, message, function() {});