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(PrefRegistrySyncable* registry) { | 90 void DefaultProvider::RegisterUserPrefs( |
| 91 user_prefs::PrefRegistrySyncable* registry) { |
91 // The registration of the preference prefs::kDefaultContentSettings should | 92 // The registration of the preference prefs::kDefaultContentSettings should |
92 // also include the default values for default content settings. This allows | 93 // also include the default values for default content settings. This allows |
93 // functional tests to get default content settings by reading the preference | 94 // functional tests to get default content settings by reading the preference |
94 // prefs::kDefaultContentSettings via pyauto. | 95 // prefs::kDefaultContentSettings via pyauto. |
95 // TODO(markusheintz): Write pyauto hooks for the content settings map as | 96 // TODO(markusheintz): Write pyauto hooks for the content settings map as |
96 // content settings should be read from the host content settings map. | 97 // content settings should be read from the host content settings map. |
97 DictionaryValue* default_content_settings = new DictionaryValue(); | 98 DictionaryValue* default_content_settings = new DictionaryValue(); |
98 registry->RegisterDictionaryPref(prefs::kDefaultContentSettings, | 99 registry->RegisterDictionaryPref( |
99 default_content_settings, | 100 prefs::kDefaultContentSettings, |
100 PrefRegistrySyncable::SYNCABLE_PREF); | 101 default_content_settings, |
| 102 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
101 } | 103 } |
102 | 104 |
103 DefaultProvider::DefaultProvider(PrefService* prefs, bool incognito) | 105 DefaultProvider::DefaultProvider(PrefService* prefs, bool incognito) |
104 : prefs_(prefs), | 106 : prefs_(prefs), |
105 is_incognito_(incognito), | 107 is_incognito_(incognito), |
106 updating_preferences_(false) { | 108 updating_preferences_(false) { |
107 DCHECK(prefs_); | 109 DCHECK(prefs_); |
108 | 110 |
109 // Read global defaults. | 111 // Read global defaults. |
110 ReadDefaultSettings(true); | 112 ReadDefaultSettings(true); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // Migrate obsolete cookie prompt mode. | 320 // Migrate obsolete cookie prompt mode. |
319 if (ValueToContentSetting( | 321 if (ValueToContentSetting( |
320 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == | 322 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == |
321 CONTENT_SETTING_ASK) { | 323 CONTENT_SETTING_ASK) { |
322 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( | 324 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( |
323 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); | 325 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); |
324 } | 326 } |
325 } | 327 } |
326 | 328 |
327 } // namespace content_settings | 329 } // namespace content_settings |
OLD | NEW |