Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(874)

Unified Diff: chrome/browser/search/hotword_service.cc

Issue 471853002: Use the new hotword extension in the launcher when it is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/search/hotword_service.cc
diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc
index e29a08ff4fa424dd9e944fc2a24f96fd567e1172..2f75b0394f5b73731f80cbde6ea0afd001deb541 100644
--- a/chrome/browser/search/hotword_service.cc
+++ b/chrome/browser/search/hotword_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/search/hotword_service.h"
+#include "base/command_line.h"
#include "base/i18n/case_conversion.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
@@ -20,6 +21,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/hotword_service_factory.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
@@ -173,6 +175,12 @@ bool HotwordService::DoesHotwordSupportLanguage(Profile* profile) {
return false;
}
+// static
+bool HotwordService::IsExperimentalHotwordingEnabled() {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ return command_line->HasSwitch(switches::kEnableExperimentalHotwording);
+}
+
HotwordService::HotwordService(Profile* profile)
: profile_(profile),
extension_registry_observer_(this),
@@ -447,7 +455,7 @@ void HotwordService::OnHotwordSearchEnabledChanged(
}
void HotwordService::RequestHotwordSession(HotwordClient* client) {
- if (!IsServiceAvailable() || client_)
+ if (!IsServiceAvailable() || (client_ && client_ != client))
arv (Not doing code reviews) 2014/08/14 15:48:06 This looks suspicious. Why are we exiting if the p
Jun Mukai 2014/08/14 22:10:08 IIRC there is only one client instance right now.
Anand Mistry (off Chromium) 2014/08/15 00:14:51 I have no plans to add additional clients. My only
Jun Mukai 2014/08/15 00:30:07 You seems not answering to our concerns. If we ca
return;
client_ = client;

Powered by Google App Engine
This is Rietveld 408576698