OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FEATURE_NOTIFICATION_CONTROLL
ER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FEATURE_NOTIFICATION_CONTROLL
ER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/time/time.h" |
| 10 #include "chrome/browser/notifications/notification.h" |
| 11 #include "chrome/browser/notifications/notification_delegate.h" |
| 12 #include "components/signin/core/account_id/account_id.h" |
| 13 #include "content/public/browser/notification_observer.h" |
| 14 #include "content/public/browser/notification_registrar.h" |
| 15 |
| 16 class Profile; |
| 17 class NetworkState; |
| 18 |
| 19 namespace chromeos { |
| 20 namespace quickunlock { |
| 21 |
| 22 // Quick Unlock feature notification controller is responsible for managing the |
| 23 // new feature notification displayed to the user. |
| 24 class FeatureNotificationController : public NotificationDelegate, |
| 25 public content::NotificationObserver { |
| 26 public: |
| 27 explicit FeatureNotificationController(const AccountId& account_id); |
| 28 |
| 29 // Returns true if the notification needs to be displayed for the given |
| 30 // |account_id|. |
| 31 static bool ShouldShowNotificationForAccountId(const AccountId& account_id); |
| 32 |
| 33 // content::NotificationObserver implementation. |
| 34 void Observe(int type, |
| 35 const content::NotificationSource& source, |
| 36 const content::NotificationDetails& details) override; |
| 37 |
| 38 private: |
| 39 ~FeatureNotificationController() override; |
| 40 |
| 41 // NotificationDelegate overrides: |
| 42 void Close(bool by_user) override; |
| 43 void Click() override; |
| 44 std::string id() const override; |
| 45 |
| 46 Notification* CreateNotification(); |
| 47 void UpdatePreferenceForProfile(Profile* profile); |
| 48 |
| 49 Profile* profile_; |
| 50 std::unique_ptr<content::NotificationRegistrar> registrar_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(FeatureNotificationController); |
| 53 }; |
| 54 |
| 55 } // namespace quickunlock |
| 56 } // namespace chromeos |
| 57 |
| 58 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FEATURE_NOTIFICATION_CONTR
OLLER_H_ |
OLD | NEW |