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 || {};
12 * Attach appropriate event handlers and show or hide the feedback button based
13 * on whether or not the current version of Chrome recognizes Chrome Remote
14 * Desktop as an authorized feedback source.
16 * @param {HTMLElement} container The menu containing the help and feedback
19 remoting.manageHelpAndFeedback = function(container) {
20 var helpButton = container.querySelector('.menu-help');
21 console.assert(helpButton != null, 'Missing help button.');
22 helpButton.addEventListener('click', showHelp, false);
24 var creditsButton = container.querySelector('.menu-credits');
25 console.assert(creditsButton != null, 'Missing credits button.');
26 creditsButton.addEventListener('click', showCredits, false);
28 var feedbackButton = container.querySelector('.menu-feedback');
29 console.assert(feedbackButton != null, 'Missing feedback button.');
30 var chromeVersion = parseInt(
31 window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10);
32 if (chromeVersion >= 35) {
33 feedbackButton.addEventListener('click', sendFeedback, false);
35 feedbackButton.hidden = true;
40 window.open('https://support.google.com/chrome/answer/1649523');
43 function showCredits() {
44 chrome.app.window.create(
49 'id' : 'remoting-credits'
54 * Pass the current version of Chrome Remote Desktop to the Google Feedback
55 * extension and instruct it to show the feedback dialog.
57 function sendFeedback() {
59 requestFeedback: true,
65 value: remoting.app.getExtensionInfo()
69 value: JSON.stringify(
70 remoting.ConsoleWrapper.getInstance().getHistory())
75 var kFeedbackExtensionId = 'gfdkimpbcpahaombhbimeihdjnejgicl';
76 chrome.runtime.sendMessage(kFeedbackExtensionId, message, function() {});