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

Unified Diff: chrome/browser/ui/webui/options/autofill_options_handler.h

Issue 1014913003: Hide Wallet checkbox when user signs out of sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle null service Created 5 years, 9 months 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/ui/webui/options/autofill_options_handler.h
diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.h b/chrome/browser/ui/webui/options/autofill_options_handler.h
index 13b0363261c59d26d34495e1e83f7ee721005236..a9e818d73da8d84fcf3a1d838a832d6bb5804aa9 100644
--- a/chrome/browser/ui/webui/options/autofill_options_handler.h
+++ b/chrome/browser/ui/webui/options/autofill_options_handler.h
@@ -8,6 +8,8 @@
#include <string>
#include "base/compiler_specific.h"
+#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/browser/sync/profile_sync_service_observer.h"
#include "chrome/browser/ui/webui/options/options_ui.h"
#include "components/autofill/core/browser/personal_data_manager_observer.h"
@@ -24,7 +26,8 @@ class ListValue;
namespace options {
class AutofillOptionsHandler : public OptionsPageUIHandler,
- public autofill::PersonalDataManagerObserver {
+ public autofill::PersonalDataManagerObserver,
+ public ProfileSyncServiceObserver {
public:
AutofillOptionsHandler();
~AutofillOptionsHandler() override;
@@ -38,6 +41,9 @@ class AutofillOptionsHandler : public OptionsPageUIHandler,
// PersonalDataManagerObserver implementation.
void OnPersonalDataChanged() override;
+ // ProfileSyncServiceObserver implementation.
+ void OnStateChanged() override;
+
private:
FRIEND_TEST_ALL_PREFIXES(AutofillOptionsHandlerTest, AddressToDictionary);
@@ -110,6 +116,9 @@ class AutofillOptionsHandler : public OptionsPageUIHandler,
// Unowned pointer, may not be NULL.
autofill::PersonalDataManager* personal_data_;
+ ScopedObserver<ProfileSyncService, ProfileSyncServiceBase::Observer>
+ observer_;
+
DISALLOW_COPY_AND_ASSIGN(AutofillOptionsHandler);
};
« no previous file with comments | « chrome/browser/resources/options/autofill_options.js ('k') | chrome/browser/ui/webui/options/autofill_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698