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

Side by Side Diff: content/public/test/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: rebase 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_TEST_NOTIFICATION_WATCHER_H_
6 #define CONTENT_PUBLIC_TEST_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/public/browser/notification_observer.h"
13
14 namespace content {
15
16 class NotificationDetails;
17 class NotificationSource;
18
19 // Observes a specific notification type and quits the message loop once a
20 // condition holds.
21 class NotificationWatcher
22 : public content::NotificationObserver {
23 public:
24 // Callback invoked on notifications. Should return true when the condition
25 // that the caller is waiting for is satisfied.
26 typedef base::Callback<bool(void)> ConditionTestCallback;
27
28 explicit NotificationWatcher(int notification_type,
29 const ConditionTestCallback& callback);
30 virtual ~NotificationWatcher();
31
32 void Run();
sky 2013/03/08 00:38:37 This needs better documentation. I would never exp
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_;
sky 2013/03/08 00:38:37 const
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_TEST_NOTIFICATION_WATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698