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

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

Issue 752003006: Don't support active user switching in hotwording outside ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid creating a profile if it hasn't yet been created. Created 6 years 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 | « no previous file | no next file » | 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 cecf9c5e33b7a219e022bb86e9bf74126c3f2ad3..293884de0d2f9507e33868ed2904ef9e63adf68c 100644
--- a/chrome/browser/search/hotword_service.cc
+++ b/chrome/browser/search/hotword_service.cc
@@ -819,5 +819,14 @@ void HotwordService::ActiveUserChanged() {
}
bool HotwordService::UserIsActive() {
- return profile_ == ProfileManager::GetActiveUserProfile();
+#if defined(OS_CHROMEOS)
+ // Only support multiple profiles and profile switching in ChromeOS.
+ if (user_manager::UserManager::IsInitialized()) {
+ user_manager::User* user =
+ user_manager::UserManager::Get()->GetActiveUser();
+ if (user && user->is_profile_created())
+ return profile_ == ProfileManager::GetActiveUserProfile();
+ }
+#endif
+ return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698