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

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

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/search/hotword_service.cc ('k') | chrome/browser/search/search.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 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/search/hotword_service.h" 10 #include "chrome/browser/search/hotword_service.h"
(...skipping 29 matching lines...) Expand all
40 HotwordService* hotword_service = GetForProfile(context); 40 HotwordService* hotword_service = GetForProfile(context);
41 return hotword_service && hotword_service->IsHotwordAllowed(); 41 return hotword_service && hotword_service->IsHotwordAllowed();
42 } 42 }
43 43
44 // static 44 // static
45 bool HotwordServiceFactory::IsHotwordHardwareAvailable() { 45 bool HotwordServiceFactory::IsHotwordHardwareAvailable() {
46 // TODO(rlp, dgreid): return has_hotword_hardware() 46 // TODO(rlp, dgreid): return has_hotword_hardware()
47 // Fill in once the hardware has the correct interface implemented. 47 // Fill in once the hardware has the correct interface implemented.
48 // In the meantime, this function can be used to get other parts moving 48 // In the meantime, this function can be used to get other parts moving
49 // based on a flag. 49 // based on a flag.
50 CommandLine* command_line = CommandLine::ForCurrentProcess(); 50 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
51 return command_line->HasSwitch(switches::kEnableExperimentalHotwordHardware); 51 return command_line->HasSwitch(switches::kEnableExperimentalHotwordHardware);
52 } 52 }
53 53
54 // static 54 // static
55 int HotwordServiceFactory::GetCurrentError(BrowserContext* context) { 55 int HotwordServiceFactory::GetCurrentError(BrowserContext* context) {
56 HotwordService* hotword_service = GetForProfile(context); 56 HotwordService* hotword_service = GetForProfile(context);
57 if (!hotword_service) 57 if (!hotword_service)
58 return 0; 58 return 0;
59 return hotword_service->error_message(); 59 return hotword_service->error_message();
60 } 60 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 121 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
122 prefs->RegisterBooleanPref(prefs::kHotwordAlwaysOnNotificationSeen, 122 prefs->RegisterBooleanPref(prefs::kHotwordAlwaysOnNotificationSeen,
123 false, 123 false,
124 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 124 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
125 } 125 }
126 126
127 KeyedService* HotwordServiceFactory::BuildServiceInstanceFor( 127 KeyedService* HotwordServiceFactory::BuildServiceInstanceFor(
128 BrowserContext* context) const { 128 BrowserContext* context) const {
129 return new HotwordService(Profile::FromBrowserContext(context)); 129 return new HotwordService(Profile::FromBrowserContext(context));
130 } 130 }
OLDNEW
« no previous file with comments | « chrome/browser/search/hotword_service.cc ('k') | chrome/browser/search/search.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698