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

Unified Diff: chrome/test/testing_profile.cc

Issue 6813116: Revert 81277 - Profile shouldn't own DesktopNotificationService.DesktopNotificationService is now... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/testing_profile.h ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/testing_profile.cc
===================================================================
--- chrome/test/testing_profile.cc (revision 81278)
+++ chrome/test/testing_profile.cc (working copy)
@@ -27,7 +27,6 @@
#include "chrome/browser/net/gaia/token_service.h"
#include "chrome/browser/net/pref_proxy_config_service.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
-#include "chrome/browser/notifications/desktop_notification_service_factory.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/prefs/testing_pref_store.h"
#include "chrome/browser/prerender/prerender_manager.h"
@@ -142,10 +141,6 @@
scoped_refptr<net::URLRequestContext> context_;
};
-ProfileKeyedService* CreateTestDesktopNotificationService(Profile* profile) {
- return new DesktopNotificationService(profile, NULL);
-}
-
} // namespace
TestingProfile::TestingProfile()
@@ -177,12 +172,6 @@
CHECK(temp_dir_.Set(system_tmp_dir));
}
}
-
- // Install profile keyed service factory hooks for dummy/test services
- DesktopNotificationServiceFactory::GetInstance()->set_test_factory(
- &CreateTestDesktopNotificationService);
- DesktopNotificationServiceFactory::GetInstance()->ForceAssociationBetween(
- this, NULL);
}
TestingProfile::~TestingProfile() {
@@ -373,6 +362,11 @@
return testing_prefs_;
}
+void TestingProfile::SetProfileDependencyManager(
+ ProfileDependencyManager* manager) {
+ profile_dependency_manager_ = manager;
+}
+
ProfileId TestingProfile::GetRuntimeId() {
return reinterpret_cast<ProfileId>(this);
}
@@ -699,6 +693,15 @@
return ntp_resource_cache_.get();
}
+DesktopNotificationService* TestingProfile::GetDesktopNotificationService() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (!desktop_notification_service_.get()) {
+ desktop_notification_service_.reset(new DesktopNotificationService(
+ this, NULL));
+ }
+ return desktop_notification_service_.get();
+}
+
BackgroundContentsService*
TestingProfile::GetBackgroundContentsService() const {
return NULL;
« no previous file with comments | « chrome/test/testing_profile.h ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698