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

Unified Diff: chrome/browser/search/hotword_audio_history_handler.h

Issue 687803004: [Hotword] Implement audio history pref accessing and setting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing memory leak with scoped ptrs 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/search/hotword_audio_history_handler.h
diff --git a/chrome/browser/search/hotword_audio_history_handler.h b/chrome/browser/search/hotword_audio_history_handler.h
index 76732e34669ca9714ae5aa217d8bbedbd5e5af23..9bb8919bbe0c91e1a07bf357e9b9954574311869 100644
--- a/chrome/browser/search/hotword_audio_history_handler.h
+++ b/chrome/browser/search/hotword_audio_history_handler.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_SEARCH_HOTWORD_AUDIO_HISTORY_HANDLER_H_
#define CHROME_BROWSER_SEARCH_HOTWORD_AUDIO_HISTORY_HANDLER_H_
+#include "base/memory/weak_ptr.h"
#include "base/prefs/pref_change_registrar.h"
#include "content/public/browser/browser_context.h"
@@ -18,19 +19,20 @@ class HotwordAudioHistoryHandler {
explicit HotwordAudioHistoryHandler(content::BrowserContext* context);
~HotwordAudioHistoryHandler();
- // Returns the current preference value based on the user's account info
+ // Updates the current preference value based on the user's account info
// or false if the user is not signed in.
- // TODO(rlp): Determine return value -- pref value or success?
- bool GetAudioHistoryEnabled();
+ void GetAudioHistoryEnabled();
- private:
// Sets the user's global pref value for enabling audio history.
void SetAudioHistoryEnabled(const bool enabled);
- void OnAudioHistoryEnabledChanged(const std::string& pref_name);
+ private:
+ // Callback called upon completion of the web history request.
+ void AudioHistoryComplete(bool success, bool new_enabled_value);
Profile* profile_;
- PrefChangeRegistrar pref_change_registrar_;
+
+ base::WeakPtrFactory<HotwordAudioHistoryHandler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(HotwordAudioHistoryHandler);
};
« no previous file with comments | « chrome/browser/history/web_history_service_unittest.cc ('k') | chrome/browser/search/hotword_audio_history_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698