summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramistry@chromium.org <amistry@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-11 09:16:52 +0000
committeramistry@chromium.org <amistry@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-11 09:18:58 +0000
commit49b05f8091ae40630201d1ac2a72a6a65790e743 (patch)
tree0f1f84da3fd73a9bd42815546093738011ec2f25
parentd8579c0458e4af22e5394815f6bef751deb28962 (diff)
downloadchromium_src-49b05f8091ae40630201d1ac2a72a6a65790e743.zip
chromium_src-49b05f8091ae40630201d1ac2a72a6a65790e743.tar.gz
chromium_src-49b05f8091ae40630201d1ac2a72a6a65790e743.tar.bz2
Rename the hotword flag to better reflect meaning, and move into Chrome.
The old name didn't reflect the intended meaning, to enable new built-in "Ok Google" detection functionality. Also, we don't want to restrict this functionality to ChromeOS. BUG=397019 Review URL: https://codereview.chromium.org/442183002 Cr-Commit-Position: refs/heads/master@{#288677} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288677 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/chromeos_strings.grdp8
-rw-r--r--chrome/app/generated_resources.grd8
-rw-r--r--chrome/browser/about_flags.cc12
-rw-r--r--chrome/browser/extensions/api/hotword_private/hotword_private_api.cc10
-rw-r--r--chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc10
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/extensions/api/hotword_private.idl2
-rw-r--r--chromeos/chromeos_switches.cc3
-rw-r--r--chromeos/chromeos_switches.h1
10 files changed, 23 insertions, 35 deletions
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp
index 1722939..dbf231d 100644
--- a/chrome/app/chromeos_strings.grdp
+++ b/chrome/app/chromeos_strings.grdp
@@ -5756,12 +5756,4 @@ All users must sign out to continue.
<message name="IDS_SET_TIME_TIME_LABEL" desc="Label for the time input element.">
System time
</message>
-
- <!-- 'OK Google' voice search activation display strings -->
- <message name="IDS_FLAGS_OK_GOOGLE_NAME" desc="Name of about:flags option for Ok Google.">
- Enable 'Ok Google' to activate voice search.
- </message>
- <message name="IDS_FLAGS_OK_GOOGLE_DESCRIPTION" desc="Description of about:flags option Ok Google.">
- If enabled, there will be an option in chrome:settings to enable saying 'Ok Google' to activate voice search.
- </message>
</grit-part>
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 899a60f..79d2f46 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -14473,6 +14473,14 @@ Do you accept?
<message name="IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION" desc="Description of the remember certificate error decisions lab">
Remember decisions to proceed through SSL errors for a specified length of time.
</message>
+
+ <!-- Built-in hotword detection display strings -->
+ <message name="IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_NAME" desc="Name of about:flags option for hotword detection.">
+ Enable experimental 'Ok Google' hotword detection features.
+ </message>
+ <message name="IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_DESCRIPTION" desc="Description of about:flags option for hotword detection.">
+ Enables experimental 'Ok Google' hotword detection features, such as using the built-in extension. The hotword extension from the Chrome Web Store will no longer be used.
+ </message>
</messages>
</release>
</grit>
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 39f0c055..6f2a3f1 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1886,15 +1886,13 @@ const Experiment kExperiments[] = {
data_reduction_proxy::switches::kDisableDataReductionProxyDev)
},
#endif
-#if defined(OS_CHROMEOS)
{
- "enable-ok-google-voice-search",
- IDS_FLAGS_OK_GOOGLE_NAME,
- IDS_FLAGS_OK_GOOGLE_DESCRIPTION,
- kOsCrOS,
- SINGLE_VALUE_TYPE(chromeos::switches::kEnableOkGoogleVoiceSearch)
+ "enable-experimental-hotwording",
+ IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_NAME,
+ IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_DESCRIPTION,
+ kOsDesktop,
+ SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwording)
},
-#endif
{
"enable-embedded-extension-options",
IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
diff --git a/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc b/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
index 09f56a4..53f6170 100644
--- a/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
+++ b/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
@@ -11,10 +11,8 @@
#include "chrome/browser/search/hotword_client.h"
#include "chrome/browser/search/hotword_service.h"
#include "chrome/browser/search/hotword_service_factory.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-#if defined(OS_CHROMEOS)
-#include "chromeos/chromeos_switches.h"
-#endif
#include "extensions/browser/event_router.h"
namespace extensions {
@@ -110,13 +108,9 @@ bool HotwordPrivateGetStatusFunction::RunSync() {
result.enabled_set = prefs->HasPrefPath(prefs::kHotwordSearchEnabled);
result.enabled = prefs->GetBoolean(prefs::kHotwordSearchEnabled);
result.audio_logging_enabled = false;
-#if defined(OS_CHROMEOS)
CommandLine* command_line = CommandLine::ForCurrentProcess();
result.experimental_hotword_enabled = command_line->HasSwitch(
- chromeos::switches::kEnableOkGoogleVoiceSearch);
-#else
- result.experimental_hotword_enabled = false;
-#endif
+ switches::kEnableExperimentalHotwording);
if (hotword_service)
result.audio_logging_enabled = hotword_service->IsOptedIntoAudioLogging();
diff --git a/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc b/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc
index 4dae063..03f2251 100644
--- a/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc
+++ b/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc
@@ -12,10 +12,8 @@
#include "chrome/browser/search/hotword_client.h"
#include "chrome/browser/search/hotword_service.h"
#include "chrome/browser/search/hotword_service_factory.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-#if defined(OS_CHROMEOS)
-#include "chromeos/chromeos_switches.h"
-#endif
namespace {
@@ -164,18 +162,16 @@ IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, ExperimentalHotwordEnabled) {
EXPECT_TRUE(listener.WaitUntilSatisfied());
}
-#if defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest,
- ExperimentalHotwordEnabled_ChromeOS) {
+ ExperimentalHotwordEnabled_Enabled) {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
- chromeos::switches::kEnableOkGoogleVoiceSearch);
+ switches::kEnableExperimentalHotwording);
ExtensionTestMessageListener listener("experimentalHotwordEnabled: true",
false);
ASSERT_TRUE(RunComponentExtensionTest("experimentalHotwordEnabled"))
<< message_;
EXPECT_TRUE(listener.WaitUntilSatisfied());
}
-#endif
IN_PROC_BROWSER_TEST_F(HotwordPrivateApiTest, OnEnabledChanged) {
// Trigger the pref registrar.
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 97e856f..17c6b95 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -453,6 +453,9 @@ const char kEnhancedBookmarksExperiment[] = "enhanced-bookmarks-experiment";
// installing in Chrome.
const char kEnableEphemeralApps[] = "enable-ephemeral-apps";
+// Enables experimental hotword detection features.
+const char kEnableExperimentalHotwording[] = "enable-experimental-hotwording";
+
// Enables logging for extension activity.
const char kEnableExtensionActivityLogging[] =
"enable-extension-activity-logging";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 56a9ebd..ce702ed 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -134,6 +134,7 @@ extern const char kEnhancedBookmarksExperiment[];
extern const char kEnableDomainReliability[];
extern const char kEnableEnhancedBookmarks[];
extern const char kEnableEphemeralApps[];
+extern const char kEnableExperimentalHotwording[];
extern const char kEnableExtensionActivityLogging[];
extern const char kEnableExtensionActivityLogTesting[];
extern const char kEnableFastUnload[];
diff --git a/chrome/common/extensions/api/hotword_private.idl b/chrome/common/extensions/api/hotword_private.idl
index 446577b..a9a4fc2 100644
--- a/chrome/common/extensions/api/hotword_private.idl
+++ b/chrome/common/extensions/api/hotword_private.idl
@@ -28,7 +28,7 @@
boolean audioLoggingEnabled;
// Whether experimental hotwording functionality is enabled. Mirrors the
- // "enable-ok-google-voice-search" flag.
+ // "enable-experimental-hotwording" flag.
boolean experimentalHotwordEnabled;
};
diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc
index 471c250..ab1357a 100644
--- a/chromeos/chromeos_switches.cc
+++ b/chromeos/chromeos_switches.cc
@@ -93,9 +93,6 @@ const char kEnableFileManagerMTP[] = "enable-filemanager-mtp";
const char kEnableNetworkPortalNotification[] =
"enable-network-portal-notification";
-// Enables activation of voice search by saying 'Ok Google'.
-const char kEnableOkGoogleVoiceSearch[] = "enable-ok-google-voice-search";
-
// Enables touchpad three-finger-click as middle button.
const char kEnableTouchpadThreeFingerClick[]
= "enable-touchpad-three-finger-click";
diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h
index 1c3a9ed..bed190d 100644
--- a/chromeos/chromeos_switches.h
+++ b/chromeos/chromeos_switches.h
@@ -48,7 +48,6 @@ CHROMEOS_EXPORT extern const char kEnableFileManagerMTP[];
CHROMEOS_EXPORT extern const char kEnableFirstRunUITransitions[];
CHROMEOS_EXPORT extern const char kEnableKioskMode[];
CHROMEOS_EXPORT extern const char kEnableNetworkPortalNotification[];
-CHROMEOS_EXPORT extern const char kEnableOkGoogleVoiceSearch[];
CHROMEOS_EXPORT extern const char kEnableRequestTabletSite[];
CHROMEOS_EXPORT extern const char kEnableTouchpadThreeFingerClick[];
CHROMEOS_EXPORT extern const char kEnableVideoPlayerChromecastSupport[];