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

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

Issue 11493003: Remove the protector service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix implicit ExtensionSystem -> TemplateURLService dependency Created 8 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
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/test/data/web_database/version_41.sql » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/testing_profile.h" 5 #include "chrome/test/base/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 23 matching lines...) Expand all
34 #include "chrome/browser/history/shortcuts_backend.h" 34 #include "chrome/browser/history/shortcuts_backend.h"
35 #include "chrome/browser/history/shortcuts_backend_factory.h" 35 #include "chrome/browser/history/shortcuts_backend_factory.h"
36 #include "chrome/browser/history/top_sites.h" 36 #include "chrome/browser/history/top_sites.h"
37 #include "chrome/browser/net/proxy_service_factory.h" 37 #include "chrome/browser/net/proxy_service_factory.h"
38 #include "chrome/browser/notifications/desktop_notification_service.h" 38 #include "chrome/browser/notifications/desktop_notification_service.h"
39 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 39 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
40 #include "chrome/browser/prefs/browser_prefs.h" 40 #include "chrome/browser/prefs/browser_prefs.h"
41 #include "chrome/browser/prerender/prerender_manager.h" 41 #include "chrome/browser/prerender/prerender_manager.h"
42 #include "chrome/browser/profiles/profile_dependency_manager.h" 42 #include "chrome/browser/profiles/profile_dependency_manager.h"
43 #include "chrome/browser/profiles/storage_partition_descriptor.h" 43 #include "chrome/browser/profiles/storage_partition_descriptor.h"
44 #include "chrome/browser/protector/protector_service_factory.h"
45 #include "chrome/browser/search_engines/template_url_fetcher_factory.h" 44 #include "chrome/browser/search_engines/template_url_fetcher_factory.h"
46 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" 45 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h"
47 #include "chrome/browser/webdata/web_data_service.h" 46 #include "chrome/browser/webdata/web_data_service.h"
48 #include "chrome/browser/webdata/web_data_service_factory.h" 47 #include "chrome/browser/webdata/web_data_service_factory.h"
49 #include "chrome/common/chrome_constants.h" 48 #include "chrome/common/chrome_constants.h"
50 #include "chrome/common/chrome_notification_types.h" 49 #include "chrome/common/chrome_notification_types.h"
51 #include "chrome/common/chrome_switches.h" 50 #include "chrome/common/chrome_switches.h"
52 #include "chrome/common/url_constants.h" 51 #include "chrome/common/url_constants.h"
53 #include "chrome/test/base/bookmark_load_observer.h" 52 #include "chrome/test/base/bookmark_load_observer.h"
54 #include "chrome/test/base/history_index_restore_observer.h" 53 #include "chrome/test/base/history_index_restore_observer.h"
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 policy::PolicyServiceImpl::Providers providers; 547 policy::PolicyServiceImpl::Providers providers;
549 policy_service_.reset(new policy::PolicyServiceImpl(providers)); 548 policy_service_.reset(new policy::PolicyServiceImpl(providers));
550 #else 549 #else
551 policy_service_.reset(new policy::PolicyServiceStub()); 550 policy_service_.reset(new policy::PolicyServiceStub());
552 #endif 551 #endif
553 } 552 }
554 return policy_service_.get(); 553 return policy_service_.get();
555 } 554 }
556 555
557 void TestingProfile::SetPrefService(PrefService* prefs) { 556 void TestingProfile::SetPrefService(PrefService* prefs) {
558 #if defined(ENABLE_PROTECTOR_SERVICE)
559 // ProtectorService binds itself very closely to the PrefService at the moment
560 // of Profile creation and watches pref changes to update their backup.
561 // For tests that replace the PrefService after TestingProfile creation,
562 // ProtectorService is disabled to prevent further invalid memory accesses.
563 protector::ProtectorServiceFactory::GetInstance()->
564 SetTestingFactory(this, NULL);
565 #endif
566 prefs_.reset(prefs); 557 prefs_.reset(prefs);
567 } 558 }
568 559
569 void TestingProfile::CreateTestingPrefService() { 560 void TestingProfile::CreateTestingPrefService() {
570 DCHECK(!prefs_.get()); 561 DCHECK(!prefs_.get());
571 testing_prefs_ = new TestingPrefService(); 562 testing_prefs_ = new TestingPrefService();
572 prefs_.reset(testing_prefs_); 563 prefs_.reset(testing_prefs_);
573 Profile::RegisterUserPrefs(prefs_.get()); 564 Profile::RegisterUserPrefs(prefs_.get());
574 chrome::RegisterUserPrefs(prefs_.get()); 565 chrome::RegisterUserPrefs(prefs_.get());
575 } 566 }
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 799
809 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { 800 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() {
810 DCHECK(!build_called_); 801 DCHECK(!build_called_);
811 build_called_ = true; 802 build_called_ = true;
812 return scoped_ptr<TestingProfile>(new TestingProfile( 803 return scoped_ptr<TestingProfile>(new TestingProfile(
813 path_, 804 path_,
814 delegate_, 805 delegate_,
815 extension_policy_, 806 extension_policy_,
816 pref_service_.Pass())); 807 pref_service_.Pass()));
817 } 808 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/test/data/web_database/version_41.sql » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698