OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync/profile_sync_test_util.h" | 5 #include "chrome/browser/sync/profile_sync_test_util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 31 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
32 notification_thread_->message_loop()->PostTask( | 32 notification_thread_->message_loop()->PostTask( |
33 FROM_HERE, | 33 FROM_HERE, |
34 base::Bind(&ThreadNotificationService::TearDownTask, this)); | 34 base::Bind(&ThreadNotificationService::TearDownTask, this)); |
35 done_event_.Wait(); | 35 done_event_.Wait(); |
36 } | 36 } |
37 | 37 |
38 ThreadNotificationService::~ThreadNotificationService() {} | 38 ThreadNotificationService::~ThreadNotificationService() {} |
39 | 39 |
40 void ThreadNotificationService::InitTask() { | 40 void ThreadNotificationService::InitTask() { |
41 service_.reset(new NotificationServiceImpl()); | 41 service_.reset(content::NotificationService::Create()); |
42 done_event_.Signal(); | 42 done_event_.Signal(); |
43 } | 43 } |
44 | 44 |
45 void ThreadNotificationService::TearDownTask() { | 45 void ThreadNotificationService::TearDownTask() { |
46 service_.reset(NULL); | 46 service_.reset(NULL); |
47 done_event_.Signal(); | 47 done_event_.Signal(); |
48 } | 48 } |
49 | 49 |
50 ThreadNotifier::ThreadNotifier(base::Thread* notify_thread) | 50 ThreadNotifier::ThreadNotifier(base::Thread* notify_thread) |
51 : done_event_(false, false), | 51 : done_event_(false, false), |
(...skipping 15 matching lines...) Expand all Loading... |
67 } | 67 } |
68 | 68 |
69 ThreadNotifier::~ThreadNotifier() {} | 69 ThreadNotifier::~ThreadNotifier() {} |
70 | 70 |
71 void ThreadNotifier::NotifyTask(int type, | 71 void ThreadNotifier::NotifyTask(int type, |
72 const content::NotificationSource& source, | 72 const content::NotificationSource& source, |
73 const content::NotificationDetails& details) { | 73 const content::NotificationDetails& details) { |
74 content::NotificationService::current()->Notify(type, source, details); | 74 content::NotificationService::current()->Notify(type, source, details); |
75 done_event_.Signal(); | 75 done_event_.Signal(); |
76 } | 76 } |
OLD | NEW |