| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/pref_content_settings_provider.h" | 5 #include "chrome/browser/content_settings/pref_content_settings_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
| 9 #include "chrome/browser/content_settings/content_settings_details.h" | 9 #include "chrome/browser/content_settings/content_settings_details.h" |
| 10 #include "chrome/browser/content_settings/content_settings_pattern.h" | 10 #include "chrome/browser/content_settings/content_settings_pattern.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 content_type == CONTENT_SETTINGS_TYPE_PLUGINS && | 50 content_type == CONTENT_SETTINGS_TYPE_PLUGINS && |
| 51 !CommandLine::ForCurrentProcess()->HasSwitch( | 51 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 52 switches::kEnableClickToPlay)) { | 52 switches::kEnableClickToPlay)) { |
| 53 return CONTENT_SETTING_BLOCK; | 53 return CONTENT_SETTING_BLOCK; |
| 54 } | 54 } |
| 55 return setting; | 55 return setting; |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace | 58 } // namespace |
| 59 | 59 |
| 60 namespace content_settings { |
| 61 |
| 60 PrefContentSettingsProvider::PrefContentSettingsProvider(Profile* profile) | 62 PrefContentSettingsProvider::PrefContentSettingsProvider(Profile* profile) |
| 61 : profile_(profile), | 63 : profile_(profile), |
| 62 is_off_the_record_(profile_->IsOffTheRecord()), | 64 is_off_the_record_(profile_->IsOffTheRecord()), |
| 63 updating_preferences_(false) { | 65 updating_preferences_(false) { |
| 64 PrefService* prefs = profile->GetPrefs(); | 66 PrefService* prefs = profile->GetPrefs(); |
| 65 | 67 |
| 66 // Read global defaults. | 68 // Read global defaults. |
| 67 DCHECK_EQ(arraysize(kTypeNames), | 69 DCHECK_EQ(arraysize(kTypeNames), |
| 68 static_cast<size_t>(CONTENT_SETTINGS_NUM_TYPES)); | 70 static_cast<size_t>(CONTENT_SETTINGS_NUM_TYPES)); |
| 69 ReadDefaultSettings(true); | 71 ReadDefaultSettings(true); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 NotificationType::CONTENT_SETTINGS_CHANGED, | 256 NotificationType::CONTENT_SETTINGS_CHANGED, |
| 255 Source<HostContentSettingsMap>(profile_->GetHostContentSettingsMap()), | 257 Source<HostContentSettingsMap>(profile_->GetHostContentSettingsMap()), |
| 256 Details<const ContentSettingsDetails>(&details)); | 258 Details<const ContentSettingsDetails>(&details)); |
| 257 } | 259 } |
| 258 | 260 |
| 259 | 261 |
| 260 // static | 262 // static |
| 261 void PrefContentSettingsProvider::RegisterUserPrefs(PrefService* prefs) { | 263 void PrefContentSettingsProvider::RegisterUserPrefs(PrefService* prefs) { |
| 262 prefs->RegisterDictionaryPref(prefs::kDefaultContentSettings); | 264 prefs->RegisterDictionaryPref(prefs::kDefaultContentSettings); |
| 263 } | 265 } |
| 266 |
| 267 } // namespace content_settings |
| OLD | NEW |