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

Side by Side Diff: content/public/browser/notification_watcher.h

Issue 12218078: Implement a policy to autologin a public account. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: split an assert Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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 CONTENT_PUBLIC_BROWSER_NOTIFICATION_WATCHER_H_
6 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_WATCHER_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "base/compiler_specific.h"
11 #include "base/run_loop.h"
12 #include "content/common/content_export.h"
13 #include "content/public/browser/notification_observer.h"
14
15 namespace content {
16
17 class NotificationDetails;
18 class NotificationSource;
19
20 // Observes a specific notification type and quits the message loop once a
21 // condition holds.
22 class CONTENT_EXPORT NotificationWatcher
Mattias Nissler (ping if slow) 2013/03/01 10:37:21 There's already WindowedNotificationObserver in co
dconnelly 2013/03/06 10:02:59 Done.
23 : public content::NotificationObserver {
24 public:
25 // Callback invoked on notifications. Should return true when the condition
26 // that the caller is waiting for is satisfied.
27 typedef base::Callback<bool(void)> ConditionTestCallback;
28
29 explicit NotificationWatcher(int notification_type,
30 const ConditionTestCallback& callback);
31
32 void Run();
33
34 // content::NotificationObserver:
35 virtual void Observe(int type,
36 const content::NotificationSource& source,
37 const content::NotificationDetails& details) OVERRIDE;
38
39 private:
40 int type_;
41 ConditionTestCallback callback_;
42 base::RunLoop run_loop_;
43
44 DISALLOW_COPY_AND_ASSIGN(NotificationWatcher);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_WATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698