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

Side by Side Diff: chrome/test/testing_profile.cc

Issue 7383012: Start and stop the safe browsing service depending on whether any profile is using it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_notification_types.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/test/testing_profile.h" 5 #include "chrome/test/testing_profile.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 159
160 // Install profile keyed service factory hooks for dummy/test services 160 // Install profile keyed service factory hooks for dummy/test services
161 BackgroundContentsServiceFactory::GetInstance()->SetTestingFactory( 161 BackgroundContentsServiceFactory::GetInstance()->SetTestingFactory(
162 this, NULL); 162 this, NULL);
163 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory( 163 DesktopNotificationServiceFactory::GetInstance()->SetTestingFactory(
164 this, CreateTestDesktopNotificationService); 164 this, CreateTestDesktopNotificationService);
165 SessionServiceFactory::GetInstance()->SetTestingFactory(this, NULL); 165 SessionServiceFactory::GetInstance()->SetTestingFactory(this, NULL);
166 TabRestoreServiceFactory::GetInstance()->SetTestingFactory(this, NULL); 166 TabRestoreServiceFactory::GetInstance()->SetTestingFactory(this, NULL);
167 TemplateURLServiceFactory::GetInstance()->SetTestingFactory(this, NULL); 167 TemplateURLServiceFactory::GetInstance()->SetTestingFactory(this, NULL);
168
169 NotificationService::current()->Notify(
170 chrome::NOTIFICATION_PROFILE_CREATED,
171 Source<Profile>(static_cast<Profile*>(this)),
172 NotificationService::NoDetails());
168 } 173 }
169 174
170 TestingProfile::~TestingProfile() { 175 TestingProfile::~TestingProfile() {
171 NotificationService::current()->Notify( 176 NotificationService::current()->Notify(
172 chrome::NOTIFICATION_PROFILE_DESTROYED, 177 chrome::NOTIFICATION_PROFILE_DESTROYED,
173 Source<Profile>(static_cast<Profile*>(this)), 178 Source<Profile>(static_cast<Profile*>(this)),
174 NotificationService::NoDetails()); 179 NotificationService::NoDetails());
175 180
176 profile_dependency_manager_->DestroyProfileServices(this); 181 profile_dependency_manager_->DestroyProfileServices(this);
177 182
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { 793 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() {
789 return GetExtensionSpecialStoragePolicy(); 794 return GetExtensionSpecialStoragePolicy();
790 } 795 }
791 796
792 void TestingProfile::DestroyWebDataService() { 797 void TestingProfile::DestroyWebDataService() {
793 if (!web_data_service_.get()) 798 if (!web_data_service_.get())
794 return; 799 return;
795 800
796 web_data_service_->Shutdown(); 801 web_data_service_->Shutdown();
797 } 802 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_notification_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698