Chromium Code Reviews

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

Issue 5646003: Sanitize PrefStore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, fix up unit tests. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/message_loop_proxy.h" 12 #include "base/message_loop_proxy.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
16 #include "chrome/browser/bookmarks/bookmark_model.h" 16 #include "chrome/browser/bookmarks/bookmark_model.h"
17 #include "chrome/browser/browser_thread.h" 17 #include "chrome/browser/browser_thread.h"
18 #include "chrome/browser/content_settings/host_content_settings_map.h" 18 #include "chrome/browser/content_settings/host_content_settings_map.h"
19 #include "chrome/browser/dom_ui/ntp_resource_cache.h" 19 #include "chrome/browser/dom_ui/ntp_resource_cache.h"
20 #include "chrome/browser/extensions/extension_pref_store.h"
20 #include "chrome/browser/extensions/extensions_service.h" 21 #include "chrome/browser/extensions/extensions_service.h"
21 #include "chrome/browser/favicon_service.h" 22 #include "chrome/browser/favicon_service.h"
22 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 23 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
23 #include "chrome/browser/geolocation/geolocation_permission_context.h" 24 #include "chrome/browser/geolocation/geolocation_permission_context.h"
24 #include "chrome/browser/history/history.h" 25 #include "chrome/browser/history/history.h"
25 #include "chrome/browser/history/history_backend.h" 26 #include "chrome/browser/history/history_backend.h"
26 #include "chrome/browser/history/top_sites.h" 27 #include "chrome/browser/history/top_sites.h"
27 #include "chrome/browser/in_process_webkit/webkit_context.h" 28 #include "chrome/browser/in_process_webkit/webkit_context.h"
28 #include "chrome/browser/net/gaia/token_service.h" 29 #include "chrome/browser/net/gaia/token_service.h"
29 #include "chrome/browser/net/pref_proxy_config_service.h" 30 #include "chrome/browser/net/pref_proxy_config_service.h"
(...skipping 310 matching lines...)
340 341
341 void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) { 342 void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) {
342 theme_provider->Init(this); 343 theme_provider->Init(this);
343 created_theme_provider_ = true; 344 created_theme_provider_ = true;
344 theme_provider_.reset(theme_provider); 345 theme_provider_.reset(theme_provider);
345 } 346 }
346 347
347 scoped_refptr<ExtensionsService> TestingProfile::CreateExtensionsService( 348 scoped_refptr<ExtensionsService> TestingProfile::CreateExtensionsService(
348 const CommandLine* command_line, 349 const CommandLine* command_line,
349 const FilePath& install_directory) { 350 const FilePath& install_directory) {
350 extension_prefs_.reset(new ExtensionPrefs(GetPrefs(),install_directory)); 351 extension_pref_store_.reset(new ExtensionPrefStore);
352 extension_prefs_.reset(new ExtensionPrefs(GetPrefs(),
353 install_directory,
354 extension_pref_store_.get()));
351 extensions_service_ = new ExtensionsService(this, 355 extensions_service_ = new ExtensionsService(this,
352 command_line, 356 command_line,
353 install_directory, 357 install_directory,
354 extension_prefs_.get(), 358 extension_prefs_.get(),
355 false); 359 false);
356 return extensions_service_; 360 return extensions_service_;
357 } 361 }
358 362
359 FilePath TestingProfile::GetPath() { 363 FilePath TestingProfile::GetPath() {
360 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. 364 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better.
(...skipping 171 matching lines...)
532 } 536 }
533 return profile_sync_service_.get(); 537 return profile_sync_service_.get();
534 } 538 }
535 539
536 void TestingProfile::DestroyWebDataService() { 540 void TestingProfile::DestroyWebDataService() {
537 if (!web_data_service_.get()) 541 if (!web_data_service_.get())
538 return; 542 return;
539 543
540 web_data_service_->Shutdown(); 544 web_data_service_->Shutdown();
541 } 545 }
OLDNEW
« chrome/test/testing_pref_service.h ('K') | « chrome/test/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine