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..f0e9376ed4c3dd0b5ba9215ee603e752176f2567 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,21 @@ 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: |
+ // Callbacks called upon completion of the web history requests. |
+ void GetAudioHistoryComplete(bool success, bool new_enabled_value); |
+ void SetAudioHistoryComplete(bool success, bool new_enabled_value); |
Profile* profile_; |
- PrefChangeRegistrar pref_change_registrar_; |
+ |
+ base::WeakPtrFactory<HotwordAudioHistoryHandler> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(HotwordAudioHistoryHandler); |
}; |