summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 10:57:25 +0000
committerrlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 10:57:25 +0000
commit3c31608ee11776f157049546ec439221e3c47fde (patch)
tree0cdc2888975929bacf8642b5d13a939cf6460b52
parent5fbee89f05f92d622748cef20af91ab0455aeff6 (diff)
downloadchromium_src-3c31608ee11776f157049546ec439221e3c47fde.zip
chromium_src-3c31608ee11776f157049546ec439221e3c47fde.tar.gz
chromium_src-3c31608ee11776f157049546ec439221e3c47fde.tar.bz2
[Hotword] Remove non-English languages due to feature getting bumped to next milestone.
BUG=385301 Review URL: https://codereview.chromium.org/337243003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277718 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/hotword_helper/manager.js6
-rw-r--r--chrome/browser/resources/hotword_helper/manifest.json8
-rw-r--r--chrome/browser/search/hotword_service.cc6
-rw-r--r--chrome/browser/search/hotword_service_unittest.cc6
4 files changed, 7 insertions, 19 deletions
diff --git a/chrome/browser/resources/hotword_helper/manager.js b/chrome/browser/resources/hotword_helper/manager.js
index 298835d..5b4249a 100644
--- a/chrome/browser/resources/hotword_helper/manager.js
+++ b/chrome/browser/resources/hotword_helper/manager.js
@@ -175,11 +175,7 @@ OptInManager.prototype.isEligibleUrl = function(url) {
'https://encrypted.google.'
];
var tlds = [
- 'com',
- 'co.uk',
- 'de',
- 'fr',
- 'ru'
+ 'com'
];
// Check URLs which do not have locale-based TLDs first.
diff --git a/chrome/browser/resources/hotword_helper/manifest.json b/chrome/browser/resources/hotword_helper/manifest.json
index eb21576..5d64c6d 100644
--- a/chrome/browser/resources/hotword_helper/manifest.json
+++ b/chrome/browser/resources/hotword_helper/manifest.json
@@ -13,10 +13,6 @@
"permissions": [
"*://*.google.com/*",
- "*://*.google.ru/*",
- "*://*.google.co.uk/*",
- "*://*.google.fr/*",
- "*://*.google.de/*",
"chrome://newtab/",
"hotwordPrivate",
"tabs"
@@ -25,10 +21,6 @@
"externally_connectable": {
"matches": [
"*://*.google.com/*",
- "*://*.google.ru/*",
- "*://*.google.co.uk/*",
- "*://*.google.fr/*",
- "*://*.google.de/*",
"chrome://newtab/"
]
},
diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc
index 7e67c64..8d1ccdf 100644
--- a/chrome/browser/search/hotword_service.cc
+++ b/chrome/browser/search/hotword_service.cc
@@ -45,9 +45,7 @@ namespace {
// Allowed languages for hotwording.
static const char* kSupportedLocales[] = {
"en",
- "de",
- "fr",
- "ru"
+ "en_us",
};
// Enum describing the state of the hotword preference.
@@ -168,7 +166,7 @@ bool HotwordService::DoesHotwordSupportLanguage(Profile* profile) {
StringToLowerASCII(&normalized_locale);
for (size_t i = 0; i < arraysize(kSupportedLocales); i++) {
- if (normalized_locale.compare(0, 2, kSupportedLocales[i]) == 0)
+ if (kSupportedLocales[i] == normalized_locale)
return true;
}
return false;
diff --git a/chrome/browser/search/hotword_service_unittest.cc b/chrome/browser/search/hotword_service_unittest.cc
index 9170741..a603361 100644
--- a/chrome/browser/search/hotword_service_unittest.cc
+++ b/chrome/browser/search/hotword_service_unittest.cc
@@ -101,10 +101,12 @@ TEST_F(HotwordServiceTest, IsHotwordAllowedLocale) {
EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile.get()));
SetApplicationLocale(static_cast<Profile*>(profile.get()), "en_us");
EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile.get()));
+ SetApplicationLocale(static_cast<Profile*>(profile.get()), "en_gb");
+ EXPECT_FALSE(HotwordServiceFactory::IsHotwordAllowed(profile.get()));
SetApplicationLocale(static_cast<Profile*>(profile.get()), "de_DE");
- EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile.get()));
+ EXPECT_FALSE(HotwordServiceFactory::IsHotwordAllowed(profile.get()));
SetApplicationLocale(static_cast<Profile*>(profile.get()), "fr_fr");
- EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile.get()));
+ EXPECT_FALSE(HotwordServiceFactory::IsHotwordAllowed(profile.get()));
// Test that incognito even with a valid locale and valid field trial
// still returns false.