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

Side by Side Diff: content/public/test/notification_watcher.cc

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 #include "content/public/test/notification_watcher.h"
6
7 #include "content/public/browser/notification_details.h"
8 #include "content/public/browser/notification_registrar.h"
9 #include "content/public/browser/notification_service.h"
10 #include "content/public/browser/notification_source.h"
11
12 namespace content {
13
14 NotificationWatcher::NotificationWatcher(int notification_type,
15 const ConditionTestCallback& callback)
16 : type_(notification_type),
17 callback_(callback) {
18 }
19
20 NotificationWatcher::~NotificationWatcher() {
21 }
22
23 void NotificationWatcher::Run() {
sky 2013/03/07 20:47:14 This class is effectively the same thing as Window
24 if (callback_.Run())
25 return;
26
27 content::NotificationRegistrar registrar;
28 registrar.Add(this, type_, content::NotificationService::AllSources());
29 run_loop_.Run();
30 }
31
32 void NotificationWatcher::Observe(
33 int type,
34 const content::NotificationSource& source,
35 const content::NotificationDetails& details) {
36 if (callback_.Run())
37 run_loop_.Quit();
38 }
39
40 } // namespace content
OLDNEW
« content/public/test/notification_watcher.h ('K') | « content/public/test/notification_watcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698