OLD | NEW |
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/search/hotword_audio_history_handler.h" | 5 #include "chrome/browser/search/hotword_audio_history_handler.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | |
8 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h" | 7 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h" |
9 #include "chrome/browser/history/web_history_service_factory.h" | 8 #include "chrome/browser/history/web_history_service_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
12 #include "components/history/core/browser/web_history_service.h" | 11 #include "components/history/core/browser/web_history_service.h" |
| 12 #include "components/prefs/pref_service.h" |
13 | 13 |
14 using extensions::BrowserContextKeyedAPIFactory; | 14 using extensions::BrowserContextKeyedAPIFactory; |
15 using extensions::HotwordPrivateEventService; | 15 using extensions::HotwordPrivateEventService; |
16 | 16 |
17 // Max number of hours between audio history checks. | 17 // Max number of hours between audio history checks. |
18 static const int kHoursUntilNextAudioHistoryCheck = 24; | 18 static const int kHoursUntilNextAudioHistoryCheck = 24; |
19 | 19 |
20 HotwordAudioHistoryHandler::HotwordAudioHistoryHandler( | 20 HotwordAudioHistoryHandler::HotwordAudioHistoryHandler( |
21 content::BrowserContext* context, | 21 content::BrowserContext* context, |
22 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) | 22 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 callback.Run(success, value); | 113 callback.Run(success, value); |
114 } | 114 } |
115 | 115 |
116 void HotwordAudioHistoryHandler::SetAudioHistoryComplete( | 116 void HotwordAudioHistoryHandler::SetAudioHistoryComplete( |
117 bool new_enabled_value, | 117 bool new_enabled_value, |
118 const HotwordAudioHistoryCallback& callback, | 118 const HotwordAudioHistoryCallback& callback, |
119 bool success, bool callback_enabled_value) { | 119 bool success, bool callback_enabled_value) { |
120 UpdateLocalPreference(success, new_enabled_value); | 120 UpdateLocalPreference(success, new_enabled_value); |
121 callback.Run(success, new_enabled_value); | 121 callback.Run(success, new_enabled_value); |
122 } | 122 } |
OLD | NEW |