diff options
author | droger <droger@chromium.org> | 2015-10-16 02:07:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-16 09:07:40 +0000 |
commit | fd959bad4fe04f3050651ad0cc36be4e948f0b3c (patch) | |
tree | dbe1e08c67e2b6511d583a0812cd0ae36878a6e5 /components/version_ui | |
parent | a7553ab719b9183eab2ee7eae434c11dff2d2ed1 (diff) | |
download | chromium_src-fd959bad4fe04f3050651ad0cc36be4e948f0b3c.zip chromium_src-fd959bad4fe04f3050651ad0cc36be4e948f0b3c.tar.gz chromium_src-fd959bad4fe04f3050651ad0cc36be4e948f0b3c.tar.bz2 |
Move resources for version_ui to //components/version_ui
These files are moved in order to be shared on iOS.
- moved the resources to //components/version_ui/resources
- moved the strings to //components
- Merged version_info strings into version_ui strings.
- Renamed IDX_ABOUT_VERSION_* to IDX_VERSION_UI_*.
- moved the constants to //components/version_ui/version_ui_constants
TBR=jochen
Review URL: https://codereview.chromium.org/1332353003
Cr-Commit-Position: refs/heads/master@{#354477}
Diffstat (limited to 'components/version_ui')
-rw-r--r-- | components/version_ui/BUILD.gn | 10 | ||||
-rw-r--r-- | components/version_ui/OWNERS | 7 | ||||
-rw-r--r-- | components/version_ui/resources/about_version.css | 63 | ||||
-rw-r--r-- | components/version_ui/resources/about_version.html | 125 | ||||
-rw-r--r-- | components/version_ui/resources/about_version.js | 48 | ||||
-rw-r--r-- | components/version_ui/resources/about_version_mobile.css | 18 | ||||
-rw-r--r-- | components/version_ui/version_ui_constants.cc | 51 | ||||
-rw-r--r-- | components/version_ui/version_ui_constants.h | 57 |
8 files changed, 379 insertions, 0 deletions
diff --git a/components/version_ui/BUILD.gn b/components/version_ui/BUILD.gn new file mode 100644 index 0000000..fd7e2f5 --- /dev/null +++ b/components/version_ui/BUILD.gn @@ -0,0 +1,10 @@ +# 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. + +source_set("version_ui") { + sources = [ + "version_ui_constants.cc", + "version_ui_constants.h", + ] +} diff --git a/components/version_ui/OWNERS b/components/version_ui/OWNERS new file mode 100644 index 0000000..da582444 --- /dev/null +++ b/components/version_ui/OWNERS @@ -0,0 +1,7 @@ +bauerb@chromium.org +dbeam@chromium.org +estade@chromium.org +jhawkins@chromium.org +nkostylev@chromium.org +pam@chromium.org +xiyuan@chromium.org diff --git a/components/version_ui/resources/about_version.css b/components/version_ui/resources/about_version.css new file mode 100644 index 0000000..6ac70ed --- /dev/null +++ b/components/version_ui/resources/about_version.css @@ -0,0 +1,63 @@ +/* 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 { + background-color: white; + color: black; + font-size: 100%; + margin: 0; +} + +#outer { + margin-left: auto; + margin-right: auto; + margin-top: 10px; + width: 800px; +} + +#inner { + padding-top: 10px; + word-break: break-word; +} + +.label { + -webkit-padding-end: 5px; + font-size: 0.9em; + font-weight: bold; + text-align: end; + vertical-align: top; + white-space: nowrap; +} + +.label::after { + content: ':'; +} + +#logo { + float: right; + margin-left: 40px; + text-align: right; + width: 180px; +} + +#company { + font-size: 0.7em; + text-align: right; +} + +#copyright { + font-size: 0.7em; + text-align: right; +} + +#useragent { + font-family: monospace; +} + +.version { + font-family: monospace; + max-width: 430px; + padding-left: 5px; + vertical-align: bottom; +} diff --git a/components/version_ui/resources/about_version.html b/components/version_ui/resources/about_version.html new file mode 100644 index 0000000..8a3bdf2 --- /dev/null +++ b/components/version_ui/resources/about_version.html @@ -0,0 +1,125 @@ +<!doctype html> + +<!-- +about:version template page +--> + +<html id="t" i18n-values="dir:textdirection;lang:language"> + <head> + <meta charset="utf-8"> + <title i18n-content="title"></title> + <link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> +<if expr="is_android or is_ios"> + <meta name="viewport" content="width=device-width"> +</if> + <link rel="stylesheet" href="chrome://version/about_version.css"> +<if expr="is_android or is_ios"> + <link rel="stylesheet" href="about_version_mobile.css"> +</if> + +<if expr="is_ios"> + <!-- TODO(jyquinn): Remove this once CRWWebUIPageBuilder can inject it. + See http://crbug.com/487000 --> + <script src="chrome://resources/js/ios/web_ui.js"></script> +</if> + + <script src="chrome://resources/js/cr.js"></script> + <script src="chrome://resources/js/load_time_data.js"></script> + <script src="chrome://resources/js/parse_html_subset.js"></script> + <script src="chrome://resources/js/util.js"></script> + <script src="chrome://version/version.js"></script> + <script src="chrome://version/strings.js"></script> + </head> + + <body> + <div id="outer"> + <div id="logo"> +<if expr="enable_themes"> + <img src="chrome://theme/IDR_PRODUCT_LOGO"> +</if> +<if expr="not enable_themes"> + <img src="../../../components/resources/default_100_percent/%DISTRIBUTION%/product_logo.png"> +</if> + <div id="company" i18n-content="company"></div> + <div id="copyright" i18n-content="copyright"></div> + </div> + <table id="inner" cellpadding="0" cellspacing="0" border="0"> + <tr><td class="label" i18n-content="application_label"></td> + <td class="version" id="version"> + <span i18n-content="version"></span> + (<span i18n-content="official"></span>) + <span i18n-content="version_modifier"></span> + <span i18n-content="version_bitsize"></span> + </td> + </tr> + <tr> + <td class="label" i18n-content="revision"></td> + <td class="version"> + <span i18n-content="cl"></span> + </td> + </tr> +<if expr="not chromeos"> + <tr><td class="label" i18n-content="os_name"></td> + <td class="version" id="os_type"> + <span i18n-content="os_type"></span> + <span id="os_version" i18n-content="os_version"></span> + </td> +</if> +<if expr="chromeos"> + <tr><td class="label" i18n-content="platform"></td> + <td class="version" id="os_type"> + <span id="os_version" i18n-content="os_version"></span> + </td> +</if> + </tr> +<if expr="not is_ios"> + <tr><td class="label">Blink</td> + <td class="version" id="blink_version" i18n-content="blink_version"></td> + </tr> + <tr><td class="label">JavaScript</td> + <td class="version" id="js_engine"> + <span i18n-content="js_engine"></span> + <span i18n-content="js_version"></span> + </td> + </tr> +</if> +<if expr="not is_android and not is_ios"> + <tr><td class="label" i18n-content="flash_plugin"></td> + <td class="version" id="flash_version" i18n-content="flash_version"></td> + </tr> +</if> + <tr><td class="label" i18n-content="user_agent_name"></td> + <td class="version" id="useragent" i18n-content="useragent"></td> + </tr> + <tr><td class="label" i18n-content="command_line_name"></td> + <td class="version" id="command_line" i18n-content="command_line"></td> + </tr> +<if expr="not is_ios"> + <tr><td class="label" i18n-content="executable_path_name"></td> + <td class="version" id="executable_path" i18n-content="executable_path"></td> + </tr> + <tr><td class="label" i18n-content="profile_path_name"></td> + <td class="version" id="profile_path" i18n-content="profile_path"></td> + </tr> +</if> + <tr id="variations-section"> + <td class="label" i18n-content="variations_name"></td> + <td class="version" id="variations-list"></td> + </tr> +<if expr="is_android"> + <tr id="build-id-section"> + <td class="label" i18n-content="build_id_name"></td> + <td class="version" i18n-content="build_id"></td> + </tr> +</if> +<if expr="is_win"> + <tr id="compiler-section"> + <td class="label">Compiler</td> + <td class="version" id="compiler" i18n-content="compiler"></td> + </tr> +</if> + </table> + </div> + <script src="chrome://resources/js/i18n_template.js"></script> + </body> +</html> diff --git a/components/version_ui/resources/about_version.js b/components/version_ui/resources/about_version.js new file mode 100644 index 0000000..476311b --- /dev/null +++ b/components/version_ui/resources/about_version.js @@ -0,0 +1,48 @@ +// Copyright (c) 2011 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. + +/** + * Callback from the backend with the list of variations to display. + * This call will build the variations section of the version page, or hide that + * section if there are none to display. + * @param {!Array<string>} variationsList The list of variations. + */ +function returnVariationInfo(variationsList) { + $('variations-section').hidden = !variationsList.length; + $('variations-list').appendChild( + parseHtmlSubset(variationsList.join('<br>'), ['BR'])); +} + +/** + * Callback from the backend with the executable and profile paths to display. + * @param {string} execPath The executable path to display. + * @param {string} profilePath The profile path to display. + */ +function returnFilePaths(execPath, profilePath) { + $('executable_path').textContent = execPath; + $('profile_path').textContent = profilePath; +} + +/** + * Callback from the backend with the Flash version to display. + * @param {string} flashVersion The Flash version to display. + */ +function returnFlashVersion(flashVersion) { + $('flash_version').textContent = flashVersion; +} + +/** + * Callback from the backend with the OS version to display. + * @param {string} osVersion The OS version to display. + */ +function returnOsVersion(osVersion) { + $('os_version').textContent = osVersion; +} + +/* All the work we do onload. */ +function onLoadWork() { + chrome.send('requestVersionInfo'); +} + +document.addEventListener('DOMContentLoaded', onLoadWork); diff --git a/components/version_ui/resources/about_version_mobile.css b/components/version_ui/resources/about_version_mobile.css new file mode 100644 index 0000000..b084d14 --- /dev/null +++ b/components/version_ui/resources/about_version_mobile.css @@ -0,0 +1,18 @@ +/* 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. */ + +#outer { + text-align: left; + width: 90%; +} + +#inner { + width: auto; +} + +#logo { + float: none; + margin-left: auto; + margin-right: auto; +} diff --git a/components/version_ui/version_ui_constants.cc b/components/version_ui/version_ui_constants.cc new file mode 100644 index 0000000..8210ad6 --- /dev/null +++ b/components/version_ui/version_ui_constants.cc @@ -0,0 +1,51 @@ +// 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. + +#include "components/version_ui/version_ui_constants.h" + +namespace version_ui { + +// Resource paths. +const char kAboutVersionCSS[] = "about_version.css"; +const char kVersionJS[] = "version.js"; + +// Message handlers. +const char kRequestVersionInfo[] = "requestVersionInfo"; +const char kReturnFilePaths[] = "returnFilePaths"; +const char kReturnFlashVersion[] = "returnFlashVersion"; +const char kReturnVariationInfo[] = "returnVariationInfo"; + +// Strings. +const char kApplicationLabel[] = "application_label"; +const char kBlinkVersion[] = "blink_version"; +const char kBuildID[] = "build_id"; +const char kBuildIDName[] = "build_id_name"; +const char kCL[] = "cl"; +const char kCommandLine[] = "command_line"; +const char kCommandLineName[] = "command_line_name"; +const char kCompany[] = "company"; +const char kCopyright[] = "copyright"; +const char kExecutablePath[] = "executable_path"; +const char kExecutablePathName[] = "executable_path_name"; +const char kFlashPlugin[] = "flash_plugin"; +const char kFlashVersion[] = "flash_version"; +const char kJSEngine[] = "js_engine"; +const char kJSVersion[] = "js_version"; +const char kOfficial[] = "official"; +const char kOSName[] = "os_name"; +const char kOSType[] = "os_type"; +const char kOSVersion[] = "os_version"; +const char kPlatform[] = "platform"; +const char kProfilePath[] = "profile_path"; +const char kProfilePathName[] = "profile_path_name"; +const char kRevision[] = "revision"; +const char kTitle[] = "title"; +const char kUserAgent[] = "useragent"; +const char kUserAgentName[] = "user_agent_name"; +const char kVariationsName[] = "variations_name"; +const char kVersion[] = "version"; +const char kVersionBitSize[] = "version_bitsize"; +const char kVersionModifier[] = "version_modifier"; + +} // namespace version_ui diff --git a/components/version_ui/version_ui_constants.h b/components/version_ui/version_ui_constants.h new file mode 100644 index 0000000..7994367 --- /dev/null +++ b/components/version_ui/version_ui_constants.h @@ -0,0 +1,57 @@ +// 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. + +#ifndef COMPONENTS_VERSION_UI_VERSION_UI_CONSTANTS_H_ +#define COMPONENTS_VERSION_UI_VERSION_UI_CONSTANTS_H_ + +namespace version_ui { + +// Resource paths. +// Must match the resource file names. +extern const char kAboutVersionCSS[]; +extern const char kVersionJS[]; + +// Message handlers. +// Must match the constants used in the resource files. +extern const char kRequestVersionInfo[]; +extern const char kReturnFilePaths[]; +extern const char kReturnFlashVersion[]; +extern const char kReturnVariationInfo[]; + +// Strings. +// Must match the constants used in the resource files. +extern const char kApplicationLabel[]; +extern const char kBlinkVersion[]; +extern const char kBuildID[]; +extern const char kBuildIDName[]; +extern const char kCL[]; +extern const char kCommandLine[]; +extern const char kCommandLineName[]; +extern const char kCompany[]; +extern const char kCopyright[]; +extern const char kExecutablePath[]; +extern const char kExecutablePathName[]; +extern const char kFlashPlugin[]; +extern const char kFlashVersion[]; +extern const char kJSEngine[]; +extern const char kJSVersion[]; +extern const char kOfficial[]; +extern const char kOSName[]; +extern const char kOSType[]; +extern const char kOSVersion[]; +extern const char kPlatform[]; +extern const char kProfilePath[]; +extern const char kProfilePathName[]; +extern const char kRevision[]; +extern const char kTitle[]; +extern const char kUserAgent[]; +extern const char kUserAgentName[]; +extern const char kVariationsName[]; +extern const char kVersion[]; +extern const char kVersionBitSize[]; +extern const char kVersionModifier[]; + +} // namespace version_ui + +#endif // COMPONENTS_VERSION_UI_VERSION_UI_CONSTANTS_H_ |