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

Unified Diff: chrome/browser/sync/avatar_sync_error_controller.h

Issue 2179283002: Refactored signin/sync error controllers for the avatar button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enum name change Created 4 years, 5 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/sync/avatar_sync_error_controller.h
diff --git a/chrome/browser/sync/avatar_sync_error_controller.h b/chrome/browser/sync/avatar_sync_error_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..10e14d8a0e4fec220c686ca4daa19b84dc6911cf
--- /dev/null
+++ b/chrome/browser/sync/avatar_sync_error_controller.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SYNC_AVATAR_SYNC_ERROR_CONTROLLER_H_
+#define CHROME_BROWSER_SYNC_AVATAR_SYNC_ERROR_CONTROLLER_H_
+
+#include "components/sync_driver/sync_error_controller.h"
+
+class Profile;
+
+// Keeps track of the sync errors that should be exposed to the user in the
+// avatar button.
+class AvatarSyncErrorController : public SyncErrorController::Observer {
+ public:
+ explicit AvatarSyncErrorController(Profile* profile);
+ ~AvatarSyncErrorController() override;
+
+ // SyncErrorController::Observer:
+ void OnErrorChanged() override;
+
+ bool has_error() { return has_error_; }
+
+ private:
+ SyncErrorController* GetSyncErrorControllerIfNeeded(Profile* profile);
+
+ Profile* profile_;
+ bool has_error_;
+
+ DISALLOW_COPY_AND_ASSIGN(AvatarSyncErrorController);
+};
+
+#endif // CHROME_BROWSER_SYNC_AVATAR_SYNC_ERROR_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698