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

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: Rebase. 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
« no previous file with comments | « chrome/browser/search/hotword_service.h ('k') | chrome/browser/ui/app_list/app_list_view_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
return;
client_ = client;
« no previous file with comments | « chrome/browser/search/hotword_service.h ('k') | chrome/browser/ui/app_list/app_list_view_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698