Chromium Code Reviews| 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_QUICK_UNLOCK_NOTIFICATION_CON TROLLER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_NOTIFICATION_CON TROLLER_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/time/time.h" | |
| 10 #include "chrome/browser/notifications/notification.h" | |
|
jdufault
2016/07/08 21:15:41
Can this class be forward declared?
malaykeshav
2016/07/09 00:43:55
Done
| |
| 11 #include "chrome/browser/notifications/notification_delegate.h" | |
| 12 #include "components/signin/core/account_id/account_id.h" | |
|
jdufault
2016/07/08 21:15:41
Is this needed?
malaykeshav
2016/07/09 00:43:55
Not anymore. Removed.
| |
| 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 | |
| 21 // Quick Unlock feature notification controller is responsible for managing the | |
| 22 // new feature notification displayed to the user. | |
| 23 class QuickUnlockNotificationController : public NotificationDelegate, | |
| 24 public content::NotificationObserver { | |
| 25 public: | |
| 26 explicit QuickUnlockNotificationController(Profile* profile); | |
| 27 | |
| 28 // Returns true if the notification needs to be displayed for the given | |
| 29 // |profile|. | |
| 30 static bool ShouldShowNotificationToProfile(Profile* profile); | |
| 31 | |
| 32 // content::NotificationObserver implementation. | |
| 33 void Observe(int type, | |
| 34 const content::NotificationSource& source, | |
| 35 const content::NotificationDetails& details) override; | |
| 36 | |
| 37 private: | |
| 38 ~QuickUnlockNotificationController() override; | |
| 39 | |
| 40 // NotificationDelegate overrides: | |
| 41 void Close(bool by_user) override; | |
| 42 void Click() override; | |
| 43 std::string id() const override; | |
| 44 | |
| 45 Notification* CreateNotification(); | |
| 46 | |
| 47 Profile* profile_; | |
| 48 std::unique_ptr<content::NotificationRegistrar> registrar_; | |
|
jdufault
2016/07/08 21:15:41
Does this need to be a unique_ptr, or can it just
malaykeshav
2016/07/09 00:43:55
Done
| |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(QuickUnlockNotificationController); | |
| 51 }; | |
| 52 | |
| 53 } // namespace chromeos | |
| 54 | |
| 55 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_NOTIFICATION_ CONTROLLER_H_ | |
| OLD | NEW |