Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync / profile_sync_test_util.cc
blob951acd38d4b7dc1ca24470b56703130dca9cd0ae
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"
7 #include "base/bind.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(
30 FROM_HERE,
31 base::Bind(&ThreadNotifier::NotifyTask, this, type, source, details));
32 done_event_.Wait();
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);
41 done_event_.Signal();