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

Side by Side Diff: chrome/browser/search/hotword_service_factory.cc

Issue 554603002: Fix a browser crash on opening 'chrome://voicesearch' in guest mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/search/hotword_service_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_factory.h" 5 #include "chrome/browser/search/hotword_service_factory.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/search/hotword_service.h" 10 #include "chrome/browser/search/hotword_service.h"
10 #include "chrome/common/pref_names.h" 11 #include "chrome/common/pref_names.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" 12 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 #include "components/pref_registry/pref_registry_syncable.h" 13 #include "components/pref_registry/pref_registry_syncable.h"
13 #include "content/public/browser/browser_context.h" 14 #include "content/public/browser/browser_context.h"
14 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
15 16
16 using content::BrowserContext; 17 using content::BrowserContext;
17 using content::BrowserThread; 18 using content::BrowserThread;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 true, 105 true,
105 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 106 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
106 prefs->RegisterStringPref(prefs::kHotwordPreviousLanguage, 107 prefs->RegisterStringPref(prefs::kHotwordPreviousLanguage,
107 std::string(), 108 std::string(),
108 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 109 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
109 prefs->RegisterBooleanPref(prefs::kHotwordAlwaysOnSearchEnabled, 110 prefs->RegisterBooleanPref(prefs::kHotwordAlwaysOnSearchEnabled,
110 false, 111 false,
111 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 112 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
112 } 113 }
113 114
115 content::BrowserContext* HotwordServiceFactory::GetBrowserContextToUse(
116 content::BrowserContext* context) const {
117 return chrome::GetBrowserContextRedirectedInIncognito(context);
rpetterson 2014/09/08 17:35:01 With this change, this will now return the origina
118 }
119
114 KeyedService* HotwordServiceFactory::BuildServiceInstanceFor( 120 KeyedService* HotwordServiceFactory::BuildServiceInstanceFor(
115 BrowserContext* context) const { 121 BrowserContext* context) const {
116 return new HotwordService(Profile::FromBrowserContext(context)); 122 return new HotwordService(Profile::FromBrowserContext(context));
117 } 123 }
OLDNEW
« no previous file with comments | « chrome/browser/search/hotword_service_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698