Skip to content

Commit

Permalink
Move resources for version_ui to //components/version_ui
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
droger authored and Commit bot committed Oct 16, 2015
1 parent a7553ab commit fd959ba
Show file tree
Hide file tree
Showing 34 changed files with 394 additions and 203 deletions.
27 changes: 14 additions & 13 deletions build/ios/grit_whitelist.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
IDR_ABOUT_VERSION_CSS
IDR_ABOUT_VERSION_HTML
IDR_ABOUT_VERSION_JS
IDR_APPLE_FLAGS_HTML
IDR_AUTOFILL_TOOLTIP_ICON
IDR_AUTOFILL_TOOLTIP_ICON_H
Expand Down Expand Up @@ -62,6 +59,9 @@ IDR_SIGNIN_INTERNALS_INDEX_HTML
IDR_SIGNIN_INTERNALS_INDEX_JS
IDR_TOOLBAR_SHADOW_FULL_BLEED
IDR_UBER_UTILS_JS
IDR_VERSION_UI_CSS
IDR_VERSION_UI_HTML
IDR_VERSION_UI_JS
IDR_WEBUI_CSS_ACTION_LINK
IDR_WEBUI_CSS_ALERT_OVERLAY
IDR_WEBUI_CSS_APPS_COMMON
Expand Down Expand Up @@ -143,18 +143,8 @@ IDR_WEBUI_JS_UTIL
IDS_ABOUT_MAC
IDS_ABOUT_VERSION_32BIT
IDS_ABOUT_VERSION_64BIT
IDS_ABOUT_VERSION_COMMAND_LINE
IDS_ABOUT_VERSION_COMPANY_NAME
IDS_ABOUT_VERSION_COPYRIGHT
IDS_ABOUT_VERSION_EXECUTABLE_PATH
IDS_ABOUT_VERSION_OFFICIAL
IDS_ABOUT_VERSION_OS
IDS_ABOUT_VERSION_PATH_NOTFOUND
IDS_ABOUT_VERSION_PROFILE_PATH
IDS_ABOUT_VERSION_REVISION
IDS_ABOUT_VERSION_TITLE
IDS_ABOUT_VERSION_USER_AGENT
IDS_ABOUT_VERSION_VARIATIONS
IDS_ACCEPT_LANGUAGES
IDS_ACCNAME_BACK
IDS_ACCNAME_CLEAR_TEXT
Expand Down Expand Up @@ -861,5 +851,16 @@ IDS_TOUCH_EVENTS_DESCRIPTION
IDS_TOUCH_EVENTS_NAME
IDS_UPGRADE_AVAILABLE
IDS_UPGRADE_AVAILABLE_BUTTON
IDS_VERSION_UI_COMMAND_LINE
IDS_VERSION_UI_EXECUTABLE_PATH
IDS_VERSION_UI_OFFICIAL
IDS_VERSION_UI_OS
IDS_VERSION_UI_PATH_NOTFOUND
IDS_VERSION_UI_PROFILE_PATH
IDS_VERSION_UI_REVISION
IDS_VERSION_UI_TITLE
IDS_VERSION_UI_UNOFFICIAL
IDS_VERSION_UI_USER_AGENT
IDS_VERSION_UI_VARIATIONS
IDS_WEB_FONT_FAMILY
IDS_WEB_FONT_SIZE
3 changes: 0 additions & 3 deletions chrome/app/chromium_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,6 @@ If you update this file, be sure also to update google_chrome_strings.grd. -->
<message name="IDS_ABOUT_VERSION_COPYRIGHT" desc="Copyright information on the about pages">
Copyright <ph name="YEAR">$1</ph> The Chromium Authors. All rights reserved.
</message>
<message name="IDS_ABOUT_VERSION_LICENSE" desc="The label below the copyright message, containing the URLs.">
Chromium is made possible by the <ph name="BEGIN_LINK_CHROMIUM">&lt;a target="_blank" href="$1"&gt;</ph>Chromium<ph name="END_LINK_CHROMIUM">&lt;/a&gt;</ph> open source project and other <ph name="BEGIN_LINK_OSS">&lt;a target="_blank" href="$2"&gt;</ph>open source software<ph name="END_LINK_OSS">&lt;/a&gt;</ph>.
</message>
<if expr="chromeos">
<message name="IDS_ABOUT_VERSION_LICENSE_EULA" desc="The label below the copyright message, containing the URLs.">
Chromium open source licenses
Expand Down
48 changes: 0 additions & 48 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -7014,54 +7014,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
This page uses a Native Client app that doesn't work on your computer.
</message>

<!-- about:version strings -->
<message name="IDS_ABOUT_VERSION_TITLE" desc="Title on the about:version page">
About Version
</message>
<message name="IDS_ABOUT_VERSION_OFFICIAL" desc="official build on the about:version page">
Official Build
</message>
<message name="IDS_ABOUT_VERSION_32BIT" desc="32-bit on the chrome://version page">
(32-bit)
</message>
<message name="IDS_ABOUT_VERSION_64BIT" desc="64-bit on the chrome://version page">
(64-bit)
</message>
<message name="IDS_ABOUT_VERSION_REVISION" desc="label for the revision on the about:version page">
Revision
</message>
<message name="IDS_ABOUT_VERSION_OS" desc="label for the OS on the about:version page">
OS
</message>
<message name="IDS_ABOUT_VERSION_USER_AGENT" desc="label for the user agent on the about:version page">
User Agent
</message>
<message name="IDS_ABOUT_VERSION_COMMAND_LINE" desc="label for the command line on the about:version page">
Command Line
</message>
<if expr="chromeos">
<message name="IDS_ABOUT_VERSION_BUILD_DATE" desc="label for build date on the about:version page">
Build Date
</message>
</if>
<message name="IDS_ABOUT_VERSION_EXECUTABLE_PATH" desc="label for the executable path on the about:version page">
Executable Path
</message>
<message name="IDS_ABOUT_VERSION_PROFILE_PATH" desc="label for the profile path on the about:version page">
Profile Path
</message>
<message name="IDS_ABOUT_VERSION_PATH_NOTFOUND" desc="label for the non-existent path on the about:version page">
No such file or directory
</message>
<message name="IDS_ABOUT_VERSION_VARIATIONS" desc="label for the variations list on the about:version page">
Variations
</message>
<if expr="is_android">
<message name="IDS_ABOUT_VERSION_BUILD_ID" desc="label for the build identifier on the about:version page">
Build ID
</message>
</if>

<!-- chrome://voicesearch strings -->
<if expr="chromeos">
<message name="IDS_VOICESEARCH_LOADING_MESSAGE" desc="Shown while loading until full list of modules is retrieved">
Expand Down
3 changes: 0 additions & 3 deletions chrome/app/google_chrome_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,6 @@ chromium_strings.grd. -->
<message name="IDS_ABOUT_VERSION_COMPANY_NAME" desc="Company name on the about pages">
Google Inc.
</message>
<message name="IDS_ABOUT_VERSION_COPYRIGHT" desc="Copyright information on the about pages">
Copyright <ph name="YEAR">$1</ph> Google Inc. All rights reserved.
</message>
<message name="IDS_ABOUT_VERSION_LICENSE" desc="The label below the copyright message, containing the URLs.">
Google Chrome is made possible by the <ph name="BEGIN_LINK_CHROMIUM">&lt;a target="_blank" href="$1"&gt;</ph>Chromium<ph name="END_LINK_CHROMIUM">&lt;/a&gt;</ph> open source project and other <ph name="BEGIN_LINK_OSS">&lt;a target="_blank" href="$2"&gt;</ph>open source software<ph name="END_LINK_OSS">&lt;/a&gt;</ph>.
</message>
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/browser_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<structure name="IDR_ABOUT_MEMORY_HTML" file="resources\about_memory.html" flattenhtml="true" type="chrome_html" />
</if>
<structure name="IDR_ABOUT_MEMORY_CSS" file="resources\about_memory.css" flattenhtml="true" type="chrome_html" />
<structure name="IDR_ABOUT_VERSION_HTML" file="resources\about_version.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" />
<if expr="enable_app_list">
<structure name="IDR_APP_LIST_START_PAGE_CSS" file="resources\app_list\start_page.css" flattenhtml="true" type="chrome_html" />
<structure name="IDR_APP_LIST_START_PAGE_HTML" file="resources\app_list\start_page.html" flattenhtml="true" type="chrome_html" />
Expand Down Expand Up @@ -89,8 +88,6 @@
<if expr="not is_android">
<include name="IDR_ABOUT_SYS_HTML" file="resources\about_sys\about_sys.html" flattenhtml="true" type="BINDATA" />
</if>
<include name="IDR_ABOUT_VERSION_JS" file="resources\about_version.js" type="BINDATA" />
<include name="IDR_ABOUT_VERSION_CSS" file="resources\about_version.css" type="BINDATA" />
<include name="IDR_AD_NETWORK_HASHES" file="resources\ad_networks.dat" type="BINDATA" />
<include name="IDR_BOOKMARKS_MANIFEST" file="resources\bookmark_manager\manifest.json" type="BINDATA" />
<if expr="is_posix and not is_macosx and not is_ios">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "components/version_info/version_info.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_registry.h"
#include "grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"

using feedback::FeedbackData;
Expand Down Expand Up @@ -255,7 +256,7 @@ scoped_ptr<base::ListValue> GetReadableFeedbackForSnapshot(
l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_LOCALE),
g_browser_process->GetApplicationLocale());
AddPair(list.get(),
l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_USER_AGENT),
l10n_util::GetStringUTF16(IDS_VERSION_UI_USER_AGENT),
GetUserAgent());
std::string version = version_info::GetVersionNumber();
version += chrome::GetChannelString();
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ source_set("ui") {
"//components/strings",
"//components/toolbar",
"//components/update_client",
"//components/version_ui",
"//content/public/common",
"//crypto",
"//skia",
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/ui/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ include_rules = [
"+components/page_load_metrics/browser",
"+components/toolbar",
"+components/url_formatter",
"+components/version_ui",
"-chrome/browser/ui/views",
]
3 changes: 2 additions & 1 deletion chrome/browser/ui/webui/flash_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "content/public/common/webplugininfo.h"
#include "gpu/config/gpu_info.h"
#include "grit/browser_resources.h"
#include "grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"

#if defined(OS_WIN)
Expand Down Expand Up @@ -262,7 +263,7 @@ void FlashDOMHandler::MaybeRespondToPage() {
if (os->architecture() == base::win::OSInfo::X64_ARCHITECTURE)
os_label += " 64 bit";
#endif
AddPair(list, l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS), os_label);
AddPair(list, l10n_util::GetStringUTF16(IDS_VERSION_UI_OS), os_label);

// Obtain the version of the Flash plugins.
std::vector<content::WebPluginInfo> info_array;
Expand Down
111 changes: 56 additions & 55 deletions chrome/browser/ui/webui/help/help_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/common/user_agent.h"
#include "grit/components_chromium_strings.h"
#include "grit/components_google_chrome_strings.h"
#include "grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "v8/include/v8.h"
Expand Down Expand Up @@ -216,71 +218,71 @@ void HelpHandler::GetLocalizedValues(base::DictionaryValue* localized_strings) {
};

static L10nResources resources[] = {
{ "aboutTitle", IDS_ABOUT_TITLE },
{"aboutTitle", IDS_ABOUT_TITLE},
#if defined(OS_CHROMEOS)
{ "aboutProductTitle", IDS_PRODUCT_OS_NAME },
{"aboutProductTitle", IDS_PRODUCT_OS_NAME},
#else
{ "aboutProductTitle", IDS_PRODUCT_NAME },
{"aboutProductTitle", IDS_PRODUCT_NAME},
#endif
{ "aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION },
{ "relaunch", IDS_RELAUNCH_BUTTON },
{"aboutProductDescription", IDS_ABOUT_PRODUCT_DESCRIPTION},
{"relaunch", IDS_RELAUNCH_BUTTON},
#if defined(OS_CHROMEOS)
{ "relaunchAndPowerwash", IDS_RELAUNCH_AND_POWERWASH_BUTTON },
{"relaunchAndPowerwash", IDS_RELAUNCH_AND_POWERWASH_BUTTON},
#endif
{ "productName", IDS_PRODUCT_NAME },
{ "updateCheckStarted", IDS_UPGRADE_CHECK_STARTED },
{ "upToDate", IDS_UPGRADE_UP_TO_DATE },
{ "updating", IDS_UPGRADE_UPDATING },
{"productName", IDS_PRODUCT_NAME},
{"updateCheckStarted", IDS_UPGRADE_CHECK_STARTED},
{"upToDate", IDS_UPGRADE_UP_TO_DATE},
{"updating", IDS_UPGRADE_UPDATING},
#if defined(OS_CHROMEOS)
{ "updateButton", IDS_UPGRADE_BUTTON },
{ "updatingChannelSwitch", IDS_UPGRADE_UPDATING_CHANNEL_SWITCH },
{"updateButton", IDS_UPGRADE_BUTTON},
{"updatingChannelSwitch", IDS_UPGRADE_UPDATING_CHANNEL_SWITCH},
#endif
{ "updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH },
{"updateAlmostDone", IDS_UPGRADE_SUCCESSFUL_RELAUNCH},
#if defined(OS_CHROMEOS)
{ "successfulChannelSwitch", IDS_UPGRADE_SUCCESSFUL_CHANNEL_SWITCH },
{"successfulChannelSwitch", IDS_UPGRADE_SUCCESSFUL_CHANNEL_SWITCH},
#endif
{ "getHelpWithChrome", IDS_GET_HELP_USING_CHROME },
{ "reportAnIssue", IDS_REPORT_AN_ISSUE },
{"getHelpWithChrome", IDS_GET_HELP_USING_CHROME},
{"reportAnIssue", IDS_REPORT_AN_ISSUE},
#if defined(OS_CHROMEOS)
{ "platform", IDS_PLATFORM_LABEL },
{ "firmware", IDS_ABOUT_PAGE_FIRMWARE },
{ "showMoreInfo", IDS_SHOW_MORE_INFO },
{ "hideMoreInfo", IDS_HIDE_MORE_INFO },
{ "channel", IDS_ABOUT_PAGE_CHANNEL },
{ "stable", IDS_ABOUT_PAGE_CHANNEL_STABLE },
{ "beta", IDS_ABOUT_PAGE_CHANNEL_BETA },
{ "dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT },
{ "channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED },
{ "currentChannelStable", IDS_ABOUT_PAGE_CURRENT_CHANNEL_STABLE },
{ "currentChannelBeta", IDS_ABOUT_PAGE_CURRENT_CHANNEL_BETA },
{ "currentChannelDev", IDS_ABOUT_PAGE_CURRENT_CHANNEL_DEV },
{ "currentChannel", IDS_ABOUT_PAGE_CURRENT_CHANNEL },
{ "channelChangeButton", IDS_ABOUT_PAGE_CHANNEL_CHANGE_BUTTON },
{ "channelChangeDisallowedMessage",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_DISALLOWED_MESSAGE },
{ "channelChangePageTitle", IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_TITLE },
{ "channelChangePagePowerwashTitle",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_POWERWASH_TITLE },
{ "channelChangePagePowerwashMessage",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_POWERWASH_MESSAGE },
{ "channelChangePageDelayedChangeTitle",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_DELAYED_CHANGE_TITLE },
{ "channelChangePageUnstableTitle",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_UNSTABLE_TITLE },
{ "channelChangePagePowerwashButton",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_POWERWASH_BUTTON },
{ "channelChangePageChangeButton",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_CHANGE_BUTTON },
{ "channelChangePageCancelButton",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_CANCEL_BUTTON },
{ "webkit", IDS_WEBKIT },
{ "userAgent", IDS_ABOUT_VERSION_USER_AGENT },
{ "commandLine", IDS_ABOUT_VERSION_COMMAND_LINE },
{ "buildDate", IDS_ABOUT_VERSION_BUILD_DATE },
{"platform", IDS_PLATFORM_LABEL},
{"firmware", IDS_ABOUT_PAGE_FIRMWARE},
{"showMoreInfo", IDS_SHOW_MORE_INFO},
{"hideMoreInfo", IDS_HIDE_MORE_INFO},
{"channel", IDS_ABOUT_PAGE_CHANNEL},
{"stable", IDS_ABOUT_PAGE_CHANNEL_STABLE},
{"beta", IDS_ABOUT_PAGE_CHANNEL_BETA},
{"dev", IDS_ABOUT_PAGE_CHANNEL_DEVELOPMENT},
{"channel-changed", IDS_ABOUT_PAGE_CHANNEL_CHANGED},
{"currentChannelStable", IDS_ABOUT_PAGE_CURRENT_CHANNEL_STABLE},
{"currentChannelBeta", IDS_ABOUT_PAGE_CURRENT_CHANNEL_BETA},
{"currentChannelDev", IDS_ABOUT_PAGE_CURRENT_CHANNEL_DEV},
{"currentChannel", IDS_ABOUT_PAGE_CURRENT_CHANNEL},
{"channelChangeButton", IDS_ABOUT_PAGE_CHANNEL_CHANGE_BUTTON},
{"channelChangeDisallowedMessage",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_DISALLOWED_MESSAGE},
{"channelChangePageTitle", IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_TITLE},
{"channelChangePagePowerwashTitle",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_POWERWASH_TITLE},
{"channelChangePagePowerwashMessage",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_POWERWASH_MESSAGE},
{"channelChangePageDelayedChangeTitle",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_DELAYED_CHANGE_TITLE},
{"channelChangePageUnstableTitle",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_UNSTABLE_TITLE},
{"channelChangePagePowerwashButton",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_POWERWASH_BUTTON},
{"channelChangePageChangeButton",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_CHANGE_BUTTON},
{"channelChangePageCancelButton",
IDS_ABOUT_PAGE_CHANNEL_CHANGE_PAGE_CANCEL_BUTTON},
{"webkit", IDS_WEBKIT},
{"userAgent", IDS_VERSION_UI_USER_AGENT},
{"commandLine", IDS_VERSION_UI_COMMAND_LINE},
{"buildDate", IDS_VERSION_UI_BUILD_DATE},
#endif
#if defined(OS_MACOSX)
{ "promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER },
{ "learnMore", IDS_LEARN_MORE },
{"promote", IDS_ABOUT_CHROME_PROMOTE_UPDATER},
{"learnMore", IDS_LEARN_MORE},
#endif
};

Expand Down Expand Up @@ -311,8 +313,7 @@ void HelpHandler::GetLocalizedValues(base::DictionaryValue* localized_strings) {
base::IntToString16(exploded_time.year)));

base::string16 license = l10n_util::GetStringFUTF16(
IDS_ABOUT_VERSION_LICENSE,
base::ASCIIToUTF16(chrome::kChromiumProjectURL),
IDS_VERSION_UI_LICENSE, base::ASCIIToUTF16(chrome::kChromiumProjectURL),
base::ASCIIToUTF16(chrome::kChromeUICreditsURL));
localized_strings->SetString("productLicense", license);

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/ui/webui/nacl_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "content/public/browser/web_ui_message_handler.h"
#include "content/public/common/webplugininfo.h"
#include "grit/browser_resources.h"
#include "grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"

#if defined(OS_WIN)
Expand Down Expand Up @@ -204,8 +205,7 @@ void NaClDomHandler::AddOperatingSystemInfo(base::ListValue* list) {
if (os->architecture() == base::win::OSInfo::X64_ARCHITECTURE)
os_label += " 64 bit";
#endif
AddPair(list,
l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_OS),
AddPair(list, l10n_util::GetStringUTF16(IDS_VERSION_UI_OS),
ASCIIToUTF16(os_label));
AddLineBreak(list);
}
Expand Down
Loading

0 comments on commit fd959ba

Please sign in to comment.