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

Side by Side Diff: chrome/browser/sync/profile_sync_test_util.cc

Issue 8913009: Hide the process of instantiating NotificationServiceImpl from embedders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_test_util.h ('k') | chrome/browser/sync/util/extensions_activity_monitor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698