summaryrefslogtreecommitdiffstats
path: root/remoting/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/webapp')
-rw-r--r--remoting/webapp/BUILD.gn25
-rw-r--r--remoting/webapp/app_remoting/js/application_context_menu.js17
-rw-r--r--remoting/webapp/base/html/credits.css67
-rw-r--r--remoting/webapp/base/html/credits.tmpl16
-rw-r--r--remoting/webapp/base/html/credits_entry.tmpl9
-rw-r--r--remoting/webapp/base/html/main.css2
-rw-r--r--remoting/webapp/base/js/credits.js19
-rw-r--r--remoting/webapp/build_template.gni2
-rw-r--r--remoting/webapp/crd/html/toolbar.html1
-rw-r--r--remoting/webapp/crd/html/ui_header.html1
-rw-r--r--remoting/webapp/crd/html/window_frame.html2
-rw-r--r--remoting/webapp/crd/js/feedback.js32
-rw-r--r--remoting/webapp/files.gni11
13 files changed, 195 insertions, 9 deletions
diff --git a/remoting/webapp/BUILD.gn b/remoting/webapp/BUILD.gn
index e3e7966..43b26a3 100644
--- a/remoting/webapp/BUILD.gn
+++ b/remoting/webapp/BUILD.gn
@@ -11,6 +11,7 @@ group("webapp") {
deps = [
":webapp_v1",
":ar_sample_app",
+ ":credits",
]
if (enable_nacl) {
@@ -45,3 +46,27 @@ app_remoting_webapp("ar_sample_app") {
app_capabilities = [ "GOOGLE_DRIVE" ]
manifest_key = "remotingdevbuild"
}
+
+# GYP version: remoting/remoting_client:remoting_credits
+action("credits") {
+ about_credits_file = "$target_gen_dir/credits.html"
+ script = "//tools/licenses.py"
+
+ inputs = [
+ "base/html/credits.tmpl",
+ "base/html/credits_entry.tmpl",
+ ]
+
+ outputs = [
+ about_credits_file,
+ ]
+
+ args = [
+ "credits",
+ rebase_path(about_credits_file, root_build_dir),
+ "--file-template",
+ rebase_path("base/html/credits.tmpl", root_build_dir),
+ "--entry-template",
+ rebase_path("base/html/credits_entry.tmpl", root_build_dir),
+ ]
+}
diff --git a/remoting/webapp/app_remoting/js/application_context_menu.js b/remoting/webapp/app_remoting/js/application_context_menu.js
index 8d15824..26051a0 100644
--- a/remoting/webapp/app_remoting/js/application_context_menu.js
+++ b/remoting/webapp/app_remoting/js/application_context_menu.js
@@ -37,6 +37,10 @@ remoting.ApplicationContextMenu = function(adapter, plugin, clientSession,
remoting.ApplicationContextMenu.kShowStatsId,
l10n.getTranslationOrError(/*i18n-content*/'SHOW_STATS'),
true);
+ this.adapter_.create(
+ remoting.ApplicationContextMenu.kShowCreditsId,
+ l10n.getTranslationOrError(/*i18n-content*/'CREDITS'),
+ true);
// TODO(kelvinp):Unhook this event on shutdown.
this.adapter_.addListener(this.onClicked_.bind(this));
@@ -118,6 +122,16 @@ remoting.ApplicationContextMenu.prototype.onClicked_ = function(info) {
case remoting.ApplicationContextMenu.kShowStatsId:
this.stats_.show(info.checked);
break;
+
+ case remoting.ApplicationContextMenu.kShowCreditsId:
+ chrome.app.window.create(
+ 'credits.html',
+ {
+ 'width': 800,
+ 'height': 600,
+ 'id' : 'remoting-credits'
+ });
+ break;
}
};
@@ -127,3 +141,6 @@ remoting.ApplicationContextMenu.kSendFeedbackId = 'send-feedback';
/** @type {string} */
remoting.ApplicationContextMenu.kShowStatsId = 'show-stats';
+
+/** @type {string} */
+remoting.ApplicationContextMenu.kShowCreditsId = 'show-credits';
diff --git a/remoting/webapp/base/html/credits.css b/remoting/webapp/base/html/credits.css
new file mode 100644
index 0000000..c61b09d
--- /dev/null
+++ b/remoting/webapp/base/html/credits.css
@@ -0,0 +1,67 @@
+/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+body {
+ overflow: auto;
+}
+
+.page-title {
+ font-size: 164%;
+ font-weight: bold;
+}
+
+.entries {
+ margin: 8px;
+}
+
+.product {
+ background-color: #c3d9ff;
+ border-radius: 5px;
+ margin-top: 16px;
+ overflow: auto;
+ padding: 2px;
+}
+
+.product .title {
+ float: left;
+ font-size: 110%;
+ font-weight: bold;
+ margin: 3px;
+}
+
+.product .homepage {
+ float: right;
+ margin: 3px;
+ text-align: right;
+}
+
+.product .homepage::after {
+ content: " - ";
+}
+
+.product .toggle-licence {
+ float: right;
+ margin: 3px;
+ text-align: right;
+}
+
+.licence {
+ background-color: #e8eef7;
+ border-radius: 3px;
+ clear: both;
+ padding: 16px;
+}
+
+.toggle-licence.hide-licence ~ .licence {
+ display: none;
+};
+
+.licence h3 {
+ margin-top: 0;
+}
+
+.licence pre {
+ white-space: pre-wrap;
+}
diff --git a/remoting/webapp/base/html/credits.tmpl b/remoting/webapp/base/html/credits.tmpl
new file mode 100644
index 0000000..836ebc6
--- /dev/null
+++ b/remoting/webapp/base/html/credits.tmpl
@@ -0,0 +1,16 @@
+<!doctype html>
+<html class="full-height">
+ <head>
+ <meta charset="utf-8">
+ <title>Credits</title>
+ <link rel="stylesheet" href="main.css">
+ <link rel="stylesheet" href="credits.css">
+ <script src="credits.js"></script>
+ </head>
+ <body class="full-height">
+ <div class="entries">
+ <div class="page-title">Credits</div>
+ {{entries}}
+ </div>
+ </body>
+</html>
diff --git a/remoting/webapp/base/html/credits_entry.tmpl b/remoting/webapp/base/html/credits_entry.tmpl
new file mode 100644
index 0000000..f30eb19
--- /dev/null
+++ b/remoting/webapp/base/html/credits_entry.tmpl
@@ -0,0 +1,9 @@
+<div class="product">
+<span class="title">{{name}}</span>
+<a class="toggle-licence hide-licence" href="#">show license</a>
+<span class="homepage"><a href="{{url}}" target="_blank">homepage</a></span>
+<div class="licence">
+<pre>{{license}}</pre>
+</div>
+</div>
+
diff --git a/remoting/webapp/base/html/main.css b/remoting/webapp/base/html/main.css
index c089e1f..172e0a4 100644
--- a/remoting/webapp/base/html/main.css
+++ b/remoting/webapp/base/html/main.css
@@ -4,7 +4,7 @@
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,
-blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em,
+blockquote, a, abbr, acronym, address, big, cite, code, del, dfn, em,
font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl,
dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody,
tfoot, thead, tr, th, td, button {
diff --git a/remoting/webapp/base/js/credits.js b/remoting/webapp/base/js/credits.js
new file mode 100644
index 0000000..cab5653
--- /dev/null
+++ b/remoting/webapp/base/js/credits.js
@@ -0,0 +1,19 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(function() {
+
+'use strict';
+
+/** @param {Event} event */
+function onClick(event) {
+ var element = /** @type {HTMLElement} */ (event.target);
+ if (element.classList.contains('toggle-licence')) {
+ element.classList.toggle('hide-licence');
+ }
+}
+
+document.addEventListener('click', onClick, false);
+
+})();
diff --git a/remoting/webapp/build_template.gni b/remoting/webapp/build_template.gni
index 0eff3e6..8c97084 100644
--- a/remoting/webapp/build_template.gni
+++ b/remoting/webapp/build_template.gni
@@ -186,6 +186,7 @@ template("desktop_remoting_webapp") {
message_window_html_output,
wcs_sandbox_html_output,
main_html_output,
+ "$target_gen_dir/credits.html",
]
# Create a file that contains a list of all the resource files needed
@@ -324,6 +325,7 @@ template("app_remoting_webapp") {
message_window_html_output,
wcs_sandbox_html_output,
main_html_output,
+ "$target_gen_dir/credits.html",
]
ar_webapp_files =
diff --git a/remoting/webapp/crd/html/toolbar.html b/remoting/webapp/crd/html/toolbar.html
index ed2a1fa..0a94896 100644
--- a/remoting/webapp/crd/html/toolbar.html
+++ b/remoting/webapp/crd/html/toolbar.html
@@ -64,6 +64,7 @@ found in the LICENSE file.
<ul class="right-align">
<li class="menu-help" i18n-content="HELP"></li>
<li class="menu-feedback" i18n-content="ACTIONBAR_FEEDBACK"></li>
+ <li class="menu-credits" i18n-content="CREDITS"></li>
</ul>
</span>
diff --git a/remoting/webapp/crd/html/ui_header.html b/remoting/webapp/crd/html/ui_header.html
index 86eb68f..45595ab 100644
--- a/remoting/webapp/crd/html/ui_header.html
+++ b/remoting/webapp/crd/html/ui_header.html
@@ -22,6 +22,7 @@ found in the LICENSE file.
<ul class="right-align">
<li class="menu-help" i18n-content="HELP"></li>
<li class="menu-feedback" i18n-content="ACTIONBAR_FEEDBACK"></li>
+ <li class="menu-credits" i18n-content="CREDITS"></li>
</ul>
</span>
</div>
diff --git a/remoting/webapp/crd/html/window_frame.html b/remoting/webapp/crd/html/window_frame.html
index 4cddc95..1729abb 100644
--- a/remoting/webapp/crd/html/window_frame.html
+++ b/remoting/webapp/crd/html/window_frame.html
@@ -35,6 +35,8 @@ found in the LICENSE file.
i18n-content="HELP"></li>
<li class="menu-feedback"
i18n-content="ACTIONBAR_FEEDBACK"></li>
+ <li class="menu-credits"
+ i18n-content="CREDITS"></li>
</ul>
</span>
<span i18n-title="DISCONNECT_MYSELF_BUTTON"
diff --git a/remoting/webapp/crd/js/feedback.js b/remoting/webapp/crd/js/feedback.js
index fe71cde..52a2c7a 100644
--- a/remoting/webapp/crd/js/feedback.js
+++ b/remoting/webapp/crd/js/feedback.js
@@ -6,6 +6,8 @@
var remoting = remoting || {};
+(function(){
+
/**
* Attach appropriate event handlers and show or hide the feedback button based
* on whether or not the current version of Chrome recognizes Chrome Remote
@@ -15,30 +17,44 @@ var remoting = remoting || {};
* items.
*/
remoting.manageHelpAndFeedback = function(container) {
- var showHelp = function() {
- window.open('https://support.google.com/chrome/answer/1649523');
- };
var helpButton = container.querySelector('.menu-help');
base.debug.assert(helpButton != null);
helpButton.addEventListener('click', showHelp, false);
+
+ var creditsButton = container.querySelector('.menu-credits');
+ base.debug.assert(creditsButton != null);
+ creditsButton.addEventListener('click', showCredits, false);
+
var feedbackButton = container.querySelector('.menu-feedback');
base.debug.assert(feedbackButton != null);
var chromeVersion = parseInt(
window.navigator.appVersion.match(/Chrome\/(\d+)\./)[1], 10);
if (chromeVersion >= 35) {
- feedbackButton.addEventListener('click',
- remoting.sendFeedback_,
- false);
+ feedbackButton.addEventListener('click', sendFeedback, false);
} else {
feedbackButton.hidden = true;
}
};
+function showHelp() {
+ window.open('https://support.google.com/chrome/answer/1649523');
+};
+
+function showCredits() {
+ chrome.app.window.create(
+ 'credits.html',
+ {
+ 'width': 800,
+ 'height': 600,
+ 'id' : 'remoting-credits'
+ });
+};
+
/**
* Pass the current version of Chrome Remote Desktop to the Google Feedback
* extension and instruct it to show the feedback dialog.
*/
-remoting.sendFeedback_ = function() {
+function sendFeedback() {
var message = {
requestFeedback: true,
feedbackInfo: {
@@ -51,3 +67,5 @@ remoting.sendFeedback_ = function() {
var kFeedbackExtensionId = 'gfdkimpbcpahaombhbimeihdjnejgicl';
chrome.runtime.sendMessage(kFeedbackExtensionId, message, function() {});
};
+
+})();
diff --git a/remoting/webapp/files.gni b/remoting/webapp/files.gni
index 7e77289..39bc081 100644
--- a/remoting/webapp/files.gni
+++ b/remoting/webapp/files.gni
@@ -434,12 +434,19 @@ remoting_webapp_message_window_html_all_js_files =
remoting_webapp_message_window_html_js_files + [ "base/js/base.js" ]
#
+# All the JavaScript files required by credits.html
+#
+
+remoting_webapp_credits_html_all_js_files = [ "base/js/credits.js" ]
+
+#
# DesktopRemoting webapp JS and resource files.
#
# All the JavaScript files that are shared by webapps.
remoting_webapp_shared_js_files = remoting_webapp_shared_main_html_js_files +
remoting_webapp_background_html_js_files +
+ remoting_webapp_credits_html_all_js_files +
remoting_webapp_message_window_html_js_files +
remoting_webapp_wcs_sandbox_html_js_files +
# JS files referenced in manifest.json.
@@ -478,6 +485,7 @@ remoting_webapp_resource_files = [
"../resources/reload.webp",
"../resources/tick.webp",
"base/html/connection_stats.css",
+ "base/html/credits.css",
"base/html/main.css",
"base/html/message_window.css",
"base/resources/open_sans.css",
@@ -608,7 +616,8 @@ ar_background_js_files = [
ar_all_js_files =
ar_main_js_files + ar_feedback_consent_html_js_files +
remoting_webapp_message_window_html_js_files +
- remoting_webapp_wcs_sandbox_html_js_files + ar_background_js_files
+ remoting_webapp_wcs_sandbox_html_js_files + ar_background_js_files +
+ remoting_webapp_credits_html_all_js_files
# Files that contain localizable strings.
app_remoting_webapp_localizable_files =