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

Side by Side Diff: chrome/browser/chromeos/login/quick_unlock/quick_unlock_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: Implements the feature notification for Quick Unlock 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 unified diff | Download patch
OLDNEW
(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_delegate.h"
11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h"
13
14 class Profile;
15 class NetworkState;
16 class Notification;
17
18 namespace chromeos {
19
20 // Quick Unlock feature notification controller is responsible for managing the
21 // new feature notification displayed to the user.
22 class QuickUnlockNotificationController : public NotificationDelegate,
23 public content::NotificationObserver {
24 public:
25 explicit QuickUnlockNotificationController(Profile* profile);
26
27 // Returns true if the notification needs to be displayed for the given
28 // |profile|.
29 static bool ShouldShow(Profile* profile);
30
31 // content::NotificationObserver implementation.
32 void Observe(int type,
33 const content::NotificationSource& source,
34 const content::NotificationDetails& details) override;
35
36 private:
37 ~QuickUnlockNotificationController() override;
38
39 // NotificationDelegate overrides:
40 void Close(bool by_user) override;
41 void Click() override;
42 std::string id() const override;
43
44 Notification* CreateNotification();
45 void UnregisterObserver();
46
47 Profile* profile_;
48 content::NotificationRegistrar registrar_;
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698