| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/search/hotword_service.h" | 5 #include "chrome/browser/search/hotword_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 hotword_audio_verification_launch_mode_ = launch_mode; | 703 hotword_audio_verification_launch_mode_ = launch_mode; |
| 704 | 704 |
| 705 ExtensionService* extension_service = GetExtensionService(profile_); | 705 ExtensionService* extension_service = GetExtensionService(profile_); |
| 706 if (!extension_service) | 706 if (!extension_service) |
| 707 return; | 707 return; |
| 708 const extensions::Extension* extension = extension_service->GetExtensionById( | 708 const extensions::Extension* extension = extension_service->GetExtensionById( |
| 709 extension_misc::kHotwordAudioVerificationAppId, true); | 709 extension_misc::kHotwordAudioVerificationAppId, true); |
| 710 if (!extension) | 710 if (!extension) |
| 711 return; | 711 return; |
| 712 | 712 |
| 713 OpenApplication( | 713 OpenApplication(AppLaunchParams( |
| 714 AppLaunchParams(profile_, extension, extensions::LAUNCH_CONTAINER_WINDOW, | 714 profile_, extension, extensions::LAUNCH_CONTAINER_WINDOW, |
| 715 NEW_WINDOW, extensions::SOURCE_CHROME_INTERNAL)); | 715 WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_CHROME_INTERNAL)); |
| 716 } | 716 } |
| 717 | 717 |
| 718 HotwordService::LaunchMode | 718 HotwordService::LaunchMode |
| 719 HotwordService::GetHotwordAudioVerificationLaunchMode() { | 719 HotwordService::GetHotwordAudioVerificationLaunchMode() { |
| 720 return hotword_audio_verification_launch_mode_; | 720 return hotword_audio_verification_launch_mode_; |
| 721 } | 721 } |
| 722 | 722 |
| 723 void HotwordService::StartTraining() { | 723 void HotwordService::StartTraining() { |
| 724 training_ = true; | 724 training_ = true; |
| 725 | 725 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 // Only support multiple profiles and profile switching in ChromeOS. | 874 // Only support multiple profiles and profile switching in ChromeOS. |
| 875 if (user_manager::UserManager::IsInitialized()) { | 875 if (user_manager::UserManager::IsInitialized()) { |
| 876 user_manager::User* user = | 876 user_manager::User* user = |
| 877 user_manager::UserManager::Get()->GetActiveUser(); | 877 user_manager::UserManager::Get()->GetActiveUser(); |
| 878 if (user && user->is_profile_created()) | 878 if (user && user->is_profile_created()) |
| 879 return profile_ == ProfileManager::GetActiveUserProfile(); | 879 return profile_ == ProfileManager::GetActiveUserProfile(); |
| 880 } | 880 } |
| 881 #endif | 881 #endif |
| 882 return true; | 882 return true; |
| 883 } | 883 } |
| OLD | NEW |