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

Unified Diff: chrome/browser/chromeos/login/quick_unlock/feature_notification_controller.h

Issue 2128053002: Implements the feature notification for Quick Unlock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/chromeos/login/quick_unlock/feature_notification_controller.h
diff --git a/chrome/browser/chromeos/login/quick_unlock/feature_notification_controller.h b/chrome/browser/chromeos/login/quick_unlock/feature_notification_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..921caf11cb9307c164768cbb6ce2624e97086ee7
--- /dev/null
+++ b/chrome/browser/chromeos/login/quick_unlock/feature_notification_controller.h
@@ -0,0 +1,58 @@
+// 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_CHROMEOS_LOGIN_QUICK_UNLOCK_FEATURE_NOTIFICATION_CONTROLLER_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FEATURE_NOTIFICATION_CONTROLLER_H_
+
+#include "base/macros.h"
+#include "base/time/time.h"
+#include "chrome/browser/notifications/notification.h"
+#include "chrome/browser/notifications/notification_delegate.h"
+#include "components/signin/core/account_id/account_id.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+
+class Profile;
+class NetworkState;
+
+namespace chromeos {
+namespace quickunlock {
+
+// Quick Unlock feature notification controller is responsible for managing the
+// new feature notification displayed to the user.
+class FeatureNotificationController : public NotificationDelegate,
+ public content::NotificationObserver {
+ public:
+ explicit FeatureNotificationController(const AccountId& account_id);
+
+ // Returns true if the notification needs to be displayed for the given
+ // |account_id|.
+ static bool ShouldShowNotificationForAccountId(const AccountId& account_id);
+
+ // content::NotificationObserver implementation.
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
+
+ private:
+ ~FeatureNotificationController() override;
+
+ // NotificationDelegate overrides:
+ void Close(bool by_user) override;
+ void Click() override;
+ std::string id() const override;
+
+ Notification* CreateNotification();
+ void UpdatePreferenceForProfile(Profile* profile);
+
+ Profile* profile_;
+ std::unique_ptr<content::NotificationRegistrar> registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(FeatureNotificationController);
+};
+
+} // namespace quickunlock
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FEATURE_NOTIFICATION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698