OLD | NEW |
---|---|
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/browser/content_settings/content_settings_pref_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_pref_provider.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 new user_prefs::PrefRegistrySyncable); | 147 new user_prefs::PrefRegistrySyncable); |
148 PrefServiceSyncable* otr_prefs = builder.CreateSyncable(otr_registry.get()); | 148 PrefServiceSyncable* otr_prefs = builder.CreateSyncable(otr_registry.get()); |
149 | 149 |
150 chrome::RegisterUserProfilePrefs(otr_registry.get()); | 150 chrome::RegisterUserProfilePrefs(otr_registry.get()); |
151 | 151 |
152 TestingProfile::Builder profile_builder; | 152 TestingProfile::Builder profile_builder; |
153 profile_builder.SetPrefService(make_scoped_ptr(regular_prefs)); | 153 profile_builder.SetPrefService(make_scoped_ptr(regular_prefs)); |
154 scoped_ptr<TestingProfile> profile = profile_builder.Build(); | 154 scoped_ptr<TestingProfile> profile = profile_builder.Build(); |
155 | 155 |
156 TestingProfile::Builder otr_profile_builder; | 156 TestingProfile::Builder otr_profile_builder; |
157 otr_profile_builder.SetIncognito(); | |
157 otr_profile_builder.SetPrefService(make_scoped_ptr(otr_prefs)); | 158 otr_profile_builder.SetPrefService(make_scoped_ptr(otr_prefs)); |
158 TestingProfile* otr_profile = otr_profile_builder.Build().release(); | 159 scoped_ptr<TestingProfile> otr_profile = otr_profile_builder.Build(); |
awong
2013/08/16 17:53:16
scoped_ptr<TestingProfile> otr_profile(otr_profile
Andrew T Wilson (Slow)
2013/08/19 12:15:56
Done.
| |
159 | 160 profile->SetOffTheRecordProfile(otr_profile.PassAs<Profile>()); |
160 otr_profile->set_incognito(true); | |
161 profile->SetOffTheRecordProfile(otr_profile); | |
162 | 161 |
163 PrefProvider pref_content_settings_provider(regular_prefs, false); | 162 PrefProvider pref_content_settings_provider(regular_prefs, false); |
164 PrefProvider pref_content_settings_provider_incognito(otr_prefs, true); | 163 PrefProvider pref_content_settings_provider_incognito(otr_prefs, true); |
165 ContentSettingsPattern pattern = | 164 ContentSettingsPattern pattern = |
166 ContentSettingsPattern::FromString("[*.]example.com"); | 165 ContentSettingsPattern::FromString("[*.]example.com"); |
167 pref_content_settings_provider.SetWebsiteSetting( | 166 pref_content_settings_provider.SetWebsiteSetting( |
168 pattern, | 167 pattern, |
169 pattern, | 168 pattern, |
170 CONTENT_SETTINGS_TYPE_IMAGES, | 169 CONTENT_SETTINGS_TYPE_IMAGES, |
171 std::string(), | 170 std::string(), |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
435 DictionaryValue* mutable_settings = update.Get(); | 434 DictionaryValue* mutable_settings = update.Get(); |
436 mutable_settings->SetWithoutPathExpansion("www.example.com,*", | 435 mutable_settings->SetWithoutPathExpansion("www.example.com,*", |
437 new base::DictionaryValue()); | 436 new base::DictionaryValue()); |
438 } | 437 } |
439 EXPECT_TRUE(observer.notification_received()); | 438 EXPECT_TRUE(observer.notification_received()); |
440 | 439 |
441 provider.ShutdownOnUIThread(); | 440 provider.ShutdownOnUIThread(); |
442 } | 441 } |
443 | 442 |
444 } // namespace content_settings | 443 } // namespace content_settings |
OLD | NEW |