Commit 5de5c9c1 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Revert "Navi: Localize Google Apps strings."

This reverts commit 5fd55b4b.

Reason for revert: I am fairly certain this is causing static initializer check failures on the official builder, because it changes BookmarkItem to be a non-POD type, and there are static BookmarkItem constants in the build: https://crbug.com/909828 

Original change's description:
> Navi: Localize Google Apps strings.
> 
> Bug: 894499
> Change-Id: I698b51eac47cdb7af63e4bb2ace338f87c5e7493
> Reviewed-on: https://chromium-review.googlesource.com/c/1351779
> Reviewed-by: Scott Chen <scottchen@chromium.org>
> Commit-Queue: Hector Carmona <hcarmona@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#611759}

TBR=hcarmona@chromium.org,scottchen@chromium.org

Change-Id: I72aff79d75c2c578c509bf4525d120c0e402cc17
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 894499
Reviewed-on: https://chromium-review.googlesource.com/c/1352682Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#611813}
parent 5de47830
......@@ -35,36 +35,6 @@
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_DESCRIPTION" desc="Description of what this section in the onboarding workflow does.">
Add bookmarks to your favorite Google Apps
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_MAPS" desc="Label for a button that creates a bookmark to maps.google.com, this should be the name of the brand.">
Maps
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_MAPS_LINK" desc="URL for the Google Maps website, this should be the replaced with a locale specific URL if it exists.">
https://maps.google.com
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_NEWS" desc="Label for a button that creates a bookmark to news.google.com, this should be the name of the brand.">
News
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_NEWS_LINK" desc="URL for the Google News website, this should be the replaced with a locale specific URL if it exists.">
https://news.google.com
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_TRANSLATE" desc="Label for a button that creates a bookmark to translate.google.com, this should be the name of the brand.">
Translate
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_TRANSLATE_LINK" desc="URL for the Google Translate website, this should be the replaced with a locale specific URL if it exists.">
https://translate.google.com
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_WEB_STORE" desc="Label for a button that creates a bookmark to chrome.google.com/webstore, this should be the name of the brand.">
Web Store
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_WEB_STORE_LINK" desc="URL for the Chrome Webstore website, this should be the replaced with a locale specific URL if it exists.">
https://chrome.google.com/webstore
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_YOUTUBE" desc="Label for a button that creates a bookmark to youtube.com, this should be the name of the brand.">
YouTube
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_YOUTUBE_LINK" desc="URL for the YouTube website, this should be the replaced with a locale specific URL if it exists.">
https://youtube.com
</message>
<!-- NUX set default module -->
<message name="IDS_ONBOARDING_WELCOME_NUX_SET_AS_DEFAULT_HEADER" desc="Header for the page that prompts user to set Chrome as their default browser.">
......
......@@ -6,7 +6,6 @@
#define CHROME_BROWSER_UI_WEBUI_WELCOME_NUX_BOOKMARK_ITEM_H_
#include <stddef.h>
#include <string>
namespace base {
class ListValue;
......@@ -16,9 +15,9 @@ namespace nux {
struct BookmarkItem {
const int id;
const std::string name;
const char* name;
const char* webui_icon;
const std::string url;
const char* url;
const int icon; // Corresponds with resource ID, used for bookmark cache.
};
......
......@@ -19,7 +19,6 @@
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
namespace nux {
......@@ -39,48 +38,24 @@ enum class GoogleApps {
const char* kGoogleAppsInteractionHistogram =
"FirstRun.NewUserExperience.GoogleAppsInteraction";
// Strings in costants not translated because this is an experiment.
// TODO(hcarmona): Translate before wide release.
const BookmarkItem kGoogleApps[] = {
{static_cast<int>(GoogleApps::kYouTube), "YouTube", "youtube",
"https://youtube.com", IDR_NUX_GOOGLE_APPS_YOUTUBE_1X},
{static_cast<int>(GoogleApps::kMaps), "Maps", "maps",
"https://maps.google.com", IDR_NUX_GOOGLE_APPS_MAPS_1X},
{static_cast<int>(GoogleApps::kNews), "News", "news",
"https://news.google.com", IDR_NUX_GOOGLE_APPS_NEWS_1X},
{static_cast<int>(GoogleApps::kTranslate), "Translate", "translate",
"https://translate.google.com", IDR_NUX_GOOGLE_APPS_TRANSLATE_1X},
{static_cast<int>(GoogleApps::kChromeWebStore), "Web Store", "web-store",
"https://chrome.google.com/webstore", IDR_NUX_GOOGLE_APPS_CHROME_STORE_1X},
};
constexpr const int kGoogleAppIconSize = 48; // Pixels.
GoogleAppsHandler::GoogleAppsHandler()
: // Do not translate icon name as it is not human visible and needs to
// match CSS.
google_apps_{{
{static_cast<int>(GoogleApps::kYouTube),
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_YOUTUBE),
"youtube",
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_YOUTUBE_LINK),
IDR_NUX_GOOGLE_APPS_YOUTUBE_1X},
{static_cast<int>(GoogleApps::kMaps),
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_MAPS),
"maps",
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_MAPS_LINK),
IDR_NUX_GOOGLE_APPS_MAPS_1X},
{static_cast<int>(GoogleApps::kNews),
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_NEWS),
"news",
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_NEWS_LINK),
IDR_NUX_GOOGLE_APPS_NEWS_1X},
{static_cast<int>(GoogleApps::kTranslate),
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_TRANSLATE),
"translate",
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_TRANSLATE_LINK),
IDR_NUX_GOOGLE_APPS_TRANSLATE_1X},
{static_cast<int>(GoogleApps::kChromeWebStore),
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_WEB_STORE),
"web-store",
l10n_util::GetStringUTF8(
IDS_ONBOARDING_WELCOME_NUX_GOOGLE_APPS_WEB_STORE_LINK),
IDR_NUX_GOOGLE_APPS_CHROME_STORE_1X},
}} {}
GoogleAppsHandler::GoogleAppsHandler() {}
GoogleAppsHandler::~GoogleAppsHandler() {}
......@@ -101,9 +76,9 @@ void GoogleAppsHandler::HandleCacheGoogleAppIcon(const base::ListValue* args) {
args->GetInteger(0, &appId);
const BookmarkItem* selectedApp = NULL;
for (size_t i = 0; i < kGoogleAppCount; i++) {
if (static_cast<int>(google_apps_[i].id) == appId) {
selectedApp = &google_apps_[i];
for (size_t i = 0; i < base::size(kGoogleApps); i++) {
if (static_cast<int>(kGoogleApps[i].id) == appId) {
selectedApp = &kGoogleApps[i];
break;
}
}
......@@ -129,7 +104,7 @@ void GoogleAppsHandler::HandleGetGoogleAppsList(const base::ListValue* args) {
CHECK(args->Get(0, &callback_id));
ResolveJavascriptCallback(
*callback_id,
bookmarkItemsToListValue(google_apps_.data(), kGoogleAppCount));
bookmarkItemsToListValue(kGoogleApps, base::size(kGoogleApps)));
}
} // namespace nux
......@@ -5,11 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_WELCOME_NUX_GOOGLE_APPS_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_WELCOME_NUX_GOOGLE_APPS_HANDLER_H_
#include <array>
#include "base/macros.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/welcome/nux/bookmark_item.h"
#include "content/public/browser/web_ui_message_handler.h"
namespace nux {
......@@ -25,8 +22,6 @@ enum class GoogleAppsInteraction {
kCount,
};
const size_t kGoogleAppCount = 5;
class GoogleAppsHandler : public content::WebUIMessageHandler {
public:
GoogleAppsHandler();
......@@ -39,9 +34,6 @@ class GoogleAppsHandler : public content::WebUIMessageHandler {
void HandleCacheGoogleAppIcon(const base::ListValue* args);
void HandleGetGoogleAppsList(const base::ListValue* args);
private:
std::array<BookmarkItem, kGoogleAppCount> google_apps_;
DISALLOW_COPY_AND_ASSIGN(GoogleAppsHandler);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment