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

Side by Side Diff: chrome/browser/extensions/api/hotword_private/hotword_private_api.cc

Issue 992173002: Delete the old hotwording integration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hotword-remove-disable-option
Patch Set: Rebase. Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/extensions/component_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h" 5 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 preamble->sample_data.swap(params->log->buffer); 219 preamble->sample_data.swap(params->log->buffer);
220 } 220 }
221 221
222 HotwordService* hotword_service = 222 HotwordService* hotword_service =
223 HotwordServiceFactory::GetForProfile(GetProfile()); 223 HotwordServiceFactory::GetForProfile(GetProfile());
224 if (hotword_service) { 224 if (hotword_service) {
225 if (hotword_service->IsTraining()) { 225 if (hotword_service->IsTraining()) {
226 hotword_service->NotifyHotwordTriggered(); 226 hotword_service->NotifyHotwordTriggered();
227 } else if (hotword_service->client()) { 227 } else if (hotword_service->client()) {
228 hotword_service->client()->OnHotwordRecognized(preamble); 228 hotword_service->client()->OnHotwordRecognized(preamble);
229 } else if (HotwordService::IsExperimentalHotwordingEnabled() && 229 } else if (hotword_service->IsAlwaysOnEnabled()) {
230 hotword_service->IsAlwaysOnEnabled()) {
231 Browser* browser = GetCurrentBrowser(); 230 Browser* browser = GetCurrentBrowser();
232 // If a Browser does not exist, fall back to the universally available, 231 // If a Browser does not exist, fall back to the universally available,
233 // but not recommended, way. 232 // but not recommended, way.
234 AppListService* app_list_service = AppListService::Get( 233 AppListService* app_list_service = AppListService::Get(
235 browser ? browser->host_desktop_type() : chrome::GetActiveDesktop()); 234 browser ? browser->host_desktop_type() : chrome::GetActiveDesktop());
236 CHECK(app_list_service); 235 CHECK(app_list_service);
237 app_list_service->ShowForVoiceSearch(GetProfile(), preamble); 236 app_list_service->ShowForVoiceSearch(GetProfile(), preamble);
238 } 237 }
239 } 238 }
240 return true; 239 return true;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 HotwordService* hotword_service = 473 HotwordService* hotword_service =
475 HotwordServiceFactory::GetForProfile(GetProfile()); 474 HotwordServiceFactory::GetForProfile(GetProfile());
476 if (!hotword_service) 475 if (!hotword_service)
477 return false; 476 return false;
478 477
479 hotword_service->SpeakerModelExistsComplete(params->exists); 478 hotword_service->SpeakerModelExistsComplete(params->exists);
480 return true; 479 return true;
481 } 480 }
482 481
483 } // namespace extensions 482 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/extensions/component_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698