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

Unified Diff: chrome/browser/history/web_history_service.h

Issue 687803004: [Hotword] Implement audio history pref accessing and setting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor cleanup Created 6 years, 1 month 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
Index: chrome/browser/history/web_history_service.h
diff --git a/chrome/browser/history/web_history_service.h b/chrome/browser/history/web_history_service.h
index 692efbb0c0c4cc5ca84a34bcfb079b0d8b68ae20..309f4f499c4c825708d3201c1e7c4dd8d4478e6a 100644
--- a/chrome/browser/history/web_history_service.h
+++ b/chrome/browser/history/web_history_service.h
@@ -50,6 +50,9 @@ class WebHistoryService : public KeyedService {
typedef base::Callback<void(bool success)> ExpireWebHistoryCallback;
+ typedef base::Callback<void(bool success, bool new_enabled_value)>
+ AudioWebHistoryCallback;
+
explicit WebHistoryService(Profile* profile);
~WebHistoryService() override;
@@ -76,6 +79,12 @@ class WebHistoryService : public KeyedService {
base::Time end_time,
const ExpireWebHistoryCallback& callback);
+ // Requests whether audio history recording is enabled.
+ void GetAudioHistoryEnabled(const AudioWebHistoryCallback& callback);
+
+ // Sets the state of audio history recording to |new_enabled_value|.
+ void SetAudioHistoryEnabled(bool new_enabled_value,
+ const AudioWebHistoryCallback& callback);
private:
// Called by |request| when a web history query has completed. Unpacks the
// response and calls |callback|, which is the original callback that was
@@ -93,6 +102,14 @@ class WebHistoryService : public KeyedService {
WebHistoryService::Request* request,
bool success);
+ // Called by |request| when a request to get or set audio history from the
+ // server has completed. Unpacks the response and calls |callback|, which is
+ // the original callback that was passed to AudioHistory().
+ void AudioHistoryCompletionCallback(
+ const WebHistoryService::AudioWebHistoryCallback& callback,
+ WebHistoryService::Request* request,
+ bool success);
+
Profile* profile_;
// Stores the version_info token received from the server in response to
@@ -104,6 +121,9 @@ class WebHistoryService : public KeyedService {
// shutdown.
std::set<Request*> pending_expire_requests_;
+ // Pending requests to be canceled if not complete by profile shutdown.
+ std::set<Request*> pending_audio_history_requests_;
+
base::WeakPtrFactory<WebHistoryService> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(WebHistoryService);
« no previous file with comments | « no previous file | chrome/browser/history/web_history_service.cc » ('j') | chrome/browser/history/web_history_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698