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_default_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_default_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 value_.release()); | 80 value_.release()); |
81 } | 81 } |
82 | 82 |
83 private: | 83 private: |
84 scoped_ptr<base::Value> value_; | 84 scoped_ptr<base::Value> value_; |
85 }; | 85 }; |
86 | 86 |
87 } // namespace | 87 } // namespace |
88 | 88 |
89 // static | 89 // static |
90 void DefaultProvider::RegisterUserPrefs(PrefService* prefs) { | 90 void DefaultProvider::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
91 // The registration of the preference prefs::kDefaultContentSettings should | 91 // The registration of the preference prefs::kDefaultContentSettings should |
92 // also include the default values for default content settings. This allows | 92 // also include the default values for default content settings. This allows |
93 // functional tests to get default content settings by reading the preference | 93 // functional tests to get default content settings by reading the preference |
94 // prefs::kDefaultContentSettings via pyauto. | 94 // prefs::kDefaultContentSettings via pyauto. |
95 // TODO(markusheintz): Write pyauto hooks for the content settings map as | 95 // TODO(markusheintz): Write pyauto hooks for the content settings map as |
96 // content settings should be read from the host content settings map. | 96 // content settings should be read from the host content settings map. |
97 DictionaryValue* default_content_settings = new DictionaryValue(); | 97 DictionaryValue* default_content_settings = new DictionaryValue(); |
98 prefs->RegisterDictionaryPref(prefs::kDefaultContentSettings, | 98 prefs->RegisterDictionaryPref(prefs::kDefaultContentSettings, |
99 default_content_settings, | 99 default_content_settings, |
100 PrefService::SYNCABLE_PREF); | 100 PrefServiceSyncable::SYNCABLE_PREF); |
101 } | 101 } |
102 | 102 |
103 DefaultProvider::DefaultProvider(PrefService* prefs, bool incognito) | 103 DefaultProvider::DefaultProvider(PrefService* prefs, bool incognito) |
104 : prefs_(prefs), | 104 : prefs_(prefs), |
105 is_incognito_(incognito), | 105 is_incognito_(incognito), |
106 updating_preferences_(false) { | 106 updating_preferences_(false) { |
107 DCHECK(prefs_); | 107 DCHECK(prefs_); |
108 | 108 |
109 // Read global defaults. | 109 // Read global defaults. |
110 ReadDefaultSettings(true); | 110 ReadDefaultSettings(true); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // Migrate obsolete cookie prompt mode. | 325 // Migrate obsolete cookie prompt mode. |
326 if (ValueToContentSetting( | 326 if (ValueToContentSetting( |
327 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == | 327 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == |
328 CONTENT_SETTING_ASK) { | 328 CONTENT_SETTING_ASK) { |
329 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( | 329 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( |
330 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); | 330 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); |
331 } | 331 } |
332 } | 332 } |
333 | 333 |
334 } // namespace content_settings | 334 } // namespace content_settings |
OLD | NEW |