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

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

Issue 7189029: Implement an initial extension settings API. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Make clang happy Created 9 years, 4 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
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/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"
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_process.h" 17 #include "chrome/browser/browser_process.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/custom_handlers/protocol_handler_registry.h" 19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
20 #include "chrome/browser/extensions/extension_pref_value_map.h" 20 #include "chrome/browser/extensions/extension_pref_value_map.h"
21 #include "chrome/browser/extensions/extension_service.h" 21 #include "chrome/browser/extensions/extension_service.h"
22 #include "chrome/browser/extensions/extension_settings.h"
22 #include "chrome/browser/extensions/extension_special_storage_policy.h" 23 #include "chrome/browser/extensions/extension_special_storage_policy.h"
23 #include "chrome/browser/favicon/favicon_service.h" 24 #include "chrome/browser/favicon/favicon_service.h"
24 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" 25 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
25 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 26 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
26 #include "chrome/browser/history/history.h" 27 #include "chrome/browser/history/history.h"
27 #include "chrome/browser/history/history_backend.h" 28 #include "chrome/browser/history/history_backend.h"
28 #include "chrome/browser/history/top_sites.h" 29 #include "chrome/browser/history/top_sites.h"
29 #include "chrome/browser/net/gaia/token_service.h" 30 #include "chrome/browser/net/gaia/token_service.h"
30 #include "chrome/browser/net/pref_proxy_config_service.h" 31 #include "chrome/browser/net/pref_proxy_config_service.h"
31 #include "chrome/browser/notifications/desktop_notification_service.h" 32 #include "chrome/browser/notifications/desktop_notification_service.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 328
328 extension_pref_value_map_.reset(new ExtensionPrefValueMap); 329 extension_pref_value_map_.reset(new ExtensionPrefValueMap);
329 // Note that the GetPrefs() creates a TestingPrefService, therefore 330 // Note that the GetPrefs() creates a TestingPrefService, therefore
330 // the extension controlled pref values set in extension_prefs_ 331 // the extension controlled pref values set in extension_prefs_
331 // are not reflected in the pref service. One would need to 332 // are not reflected in the pref service. One would need to
332 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false). 333 // inject a new ExtensionPrefStore(extension_pref_value_map_.get(), false).
333 extension_prefs_.reset( 334 extension_prefs_.reset(
334 new ExtensionPrefs(GetPrefs(), 335 new ExtensionPrefs(GetPrefs(),
335 install_directory, 336 install_directory,
336 extension_pref_value_map_.get())); 337 extension_pref_value_map_.get()));
338 extension_settings_ =
339 new ExtensionSettings(GetPath().AppendASCII("Extension Settings"));
337 extension_service_.reset(new ExtensionService(this, 340 extension_service_.reset(new ExtensionService(this,
338 command_line, 341 command_line,
339 install_directory, 342 install_directory,
340 extension_prefs_.get(), 343 extension_prefs_.get(),
344 extension_settings_.get(),
341 autoupdate_enabled, 345 autoupdate_enabled,
342 true)); 346 true));
343 return extension_service_.get(); 347 return extension_service_.get();
344 } 348 }
345 349
346 FilePath TestingProfile::GetPath() { 350 FilePath TestingProfile::GetPath() {
347 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better. 351 DCHECK(temp_dir_.IsValid()); // TODO(phajdan.jr): do it better.
348 return temp_dir_.path(); 352 return temp_dir_.path();
349 } 353 }
350 354
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { 792 quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() {
789 return GetExtensionSpecialStoragePolicy(); 793 return GetExtensionSpecialStoragePolicy();
790 } 794 }
791 795
792 void TestingProfile::DestroyWebDataService() { 796 void TestingProfile::DestroyWebDataService() {
793 if (!web_data_service_.get()) 797 if (!web_data_service_.get())
794 return; 798 return;
795 799
796 web_data_service_->Shutdown(); 800 web_data_service_->Shutdown();
797 } 801 }
OLDNEW
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | chrome/test/data/extensions/api_test/settings/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698