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
3 // found in the LICENSE file.
5 #include "chrome/browser/sync/profile_sync_test_util.h"
8 #include "base/threading/thread.h"
10 using content::BrowserThread
;
12 ProfileSyncServiceObserverMock::ProfileSyncServiceObserverMock() {}
14 ProfileSyncServiceObserverMock::~ProfileSyncServiceObserverMock() {}
16 ThreadNotifier::ThreadNotifier(base::Thread
* notify_thread
)
17 : done_event_(false, false),
18 notify_thread_(notify_thread
) {}
20 void ThreadNotifier::Notify(int type
,
21 const content::NotificationDetails
& details
) {
22 Notify(type
, content::NotificationService::AllSources(), details
);
25 void ThreadNotifier::Notify(int type
,
26 const content::NotificationSource
& source
,
27 const content::NotificationDetails
& details
) {
28 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI
));
29 notify_thread_
->message_loop()->PostTask(
31 base::Bind(&ThreadNotifier::NotifyTask
, this, type
, source
, details
));
35 ThreadNotifier::~ThreadNotifier() {}
37 void ThreadNotifier::NotifyTask(int type
,
38 const content::NotificationSource
& source
,
39 const content::NotificationDetails
& details
) {
40 content::NotificationService::current()->Notify(type
, source
, details
);