summaryrefslogtreecommitdiffstats
path: root/chrome/test/testing_profile.h
diff options
context:
space:
mode:
authorbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-25 14:25:33 +0000
committerbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-25 14:25:33 +0000
commit9a8c4020cf135d7a9073cf22a69427f1259c5ed5 (patch)
treea4125b4f356d75cdea03dab1a07f3ae14e579e89 /chrome/test/testing_profile.h
parent31a3130fedb27670365b40bc8cb6dc875957531f (diff)
downloadchromium_src-9a8c4020cf135d7a9073cf22a69427f1259c5ed5.zip
chromium_src-9a8c4020cf135d7a9073cf22a69427f1259c5ed5.tar.gz
chromium_src-9a8c4020cf135d7a9073cf22a69427f1259c5ed5.tar.bz2
Introduce incognito preference settings.
This CL introduces preference settings for incognito windows. The semantics are the following: - An extension can set regular preferences as before. These affect regular and incognito windows. - An extension can set regular preferences *and* incognito preferences. In this case, the incognito preferences affect only incognito windows. - If extension A sets reg+incognito, extension B sets reg but no incognito, extension B has higher precedence than A --> B's preferences hold for all regular and incognito windows. - Incognito preferences are never persisted to disk. In order to realize this, the ExtensionPrefs class allows setting regular and incognito extension controlled preferences. It allows creating an incognito version of the PrefService with an independent PrefValueStore. This (incognito) PrefValueStore and the original PrefValueStore share several of their PrefStores (i.e. DefaultPrefStore, CommandLinePrefStore, Configuration PrefStores) but differ in two pref stores: - We maintain two separate ExtensionPrefStores containing the effective preferences for regular and incognito windows. - We maintain two separate user pref stores. The regular JsonPrefStore is expanded by an OverlayPersistentPrefStore that maintains all write-operations in an in-memory overlay. Therefore, incognito changes are not visible in the file-backed JsonPrefStore. The two ExtensionPrefStores retrieve their effective values from a shared ExtensionPrefValueMap. The OffTheRecordProfileImpl provides a request_context_ that uses the new PrefService already. BUG=66027,69057 TEST=unit tests, will be fully testable once the Proxy Settings API allows incognito settings. Review URL: http://codereview.chromium.org/5915004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72489 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/testing_profile.h')
-rw-r--r--chrome/test/testing_profile.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index 181e375..e1e5d8b 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -25,8 +25,9 @@ class BookmarkModel;
class BrowserThemeProvider;
class CommandLine;
class DesktopNotificationService;
-class ExtensionPrefStore;
class ExtensionPrefs;
+class ExtensionPrefStore;
+class ExtensionPrefValueMap;
class FaviconService;
class FindBarState;
class GeolocationContentSettingsMap;
@@ -115,9 +116,8 @@ class TestingProfile : public Profile {
// returns it. The profile keeps its own copy of a scoped_refptr to the
// ExtensionService to make sure that is still alive to be notified when the
// profile is destroyed.
- scoped_refptr<ExtensionService> CreateExtensionService(
- const CommandLine* command_line,
- const FilePath& install_directory);
+ ExtensionService* CreateExtensionService(const CommandLine* command_line,
+ const FilePath& install_directory);
TestingPrefService* GetTestingPrefService();
@@ -322,6 +322,10 @@ class TestingProfile : public Profile {
virtual PrerenderManager* GetPrerenderManager() { return NULL; }
protected:
+ virtual ExtensionPrefValueMap* GetExtensionPrefValueMap() {
+ return extension_pref_value_map_.get();
+ }
+
base::Time start_time_;
scoped_ptr<PrefService> prefs_;
// ref only for right type, lifecycle is managed by prefs_
@@ -411,9 +415,6 @@ class TestingProfile : public Profile {
FilePath last_selected_directory_;
scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails.
- // Extension pref store, created for use by |extension_prefs_|.
- scoped_ptr<ExtensionPrefStore> extension_pref_store_;
-
// The Extension Preferences. Only created if CreateExtensionService is
// invoked.
scoped_ptr<ExtensionPrefs> extension_prefs_;
@@ -422,6 +423,8 @@ class TestingProfile : public Profile {
// is disposed.
scoped_refptr<ExtensionService> extensions_service_;
+ scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_;
+
// The proxy prefs tracker.
scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;