| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_policy_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_policy_provider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } else if (*name == prefs::kManagedDefaultPluginsSetting) { | 171 } else if (*name == prefs::kManagedDefaultPluginsSetting) { |
| 172 UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_PLUGINS); | 172 UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_PLUGINS); |
| 173 } else if (*name == prefs::kManagedDefaultPopupsSetting) { | 173 } else if (*name == prefs::kManagedDefaultPopupsSetting) { |
| 174 UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_POPUPS); | 174 UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_POPUPS); |
| 175 } else { | 175 } else { |
| 176 NOTREACHED() << "Unexpected preference observed"; | 176 NOTREACHED() << "Unexpected preference observed"; |
| 177 return; | 177 return; |
| 178 } | 178 } |
| 179 | 179 |
| 180 if (!is_off_the_record_) { | 180 if (!is_off_the_record_) { |
| 181 NotifyObservers(ContentSettingsDetails( | 181 ContentSettingsDetails details(ContentSettingsPattern(), |
| 182 ContentSettingsPattern(), CONTENT_SETTINGS_TYPE_DEFAULT, "")); | 182 CONTENT_SETTINGS_TYPE_DEFAULT, |
| 183 std::string()); |
| 184 NotifyObservers(details); |
| 183 } | 185 } |
| 184 } else if (type == NotificationType::PROFILE_DESTROYED) { | 186 } else if (type == NotificationType::PROFILE_DESTROYED) { |
| 185 DCHECK_EQ(profile_, Source<Profile>(source).ptr()); | 187 DCHECK_EQ(profile_, Source<Profile>(source).ptr()); |
| 186 UnregisterObservers(); | 188 UnregisterObservers(); |
| 187 } else { | 189 } else { |
| 188 NOTREACHED() << "Unexpected notification"; | 190 NOTREACHED() << "Unexpected notification"; |
| 189 } | 191 } |
| 190 } | 192 } |
| 191 | 193 |
| 192 void PolicyDefaultProvider::UnregisterObservers() { | 194 void PolicyDefaultProvider::UnregisterObservers() { |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 *name == prefs::kManagedCookiesSessionOnlyForUrls || | 443 *name == prefs::kManagedCookiesSessionOnlyForUrls || |
| 442 *name == prefs::kManagedImagesAllowedForUrls || | 444 *name == prefs::kManagedImagesAllowedForUrls || |
| 443 *name == prefs::kManagedImagesBlockedForUrls || | 445 *name == prefs::kManagedImagesBlockedForUrls || |
| 444 *name == prefs::kManagedJavaScriptAllowedForUrls || | 446 *name == prefs::kManagedJavaScriptAllowedForUrls || |
| 445 *name == prefs::kManagedJavaScriptBlockedForUrls || | 447 *name == prefs::kManagedJavaScriptBlockedForUrls || |
| 446 *name == prefs::kManagedPluginsAllowedForUrls || | 448 *name == prefs::kManagedPluginsAllowedForUrls || |
| 447 *name == prefs::kManagedPluginsBlockedForUrls || | 449 *name == prefs::kManagedPluginsBlockedForUrls || |
| 448 *name == prefs::kManagedPopupsAllowedForUrls || | 450 *name == prefs::kManagedPopupsAllowedForUrls || |
| 449 *name == prefs::kManagedPopupsBlockedForUrls) { | 451 *name == prefs::kManagedPopupsBlockedForUrls) { |
| 450 ReadManagedContentSettings(true); | 452 ReadManagedContentSettings(true); |
| 451 NotifyObservers(ContentSettingsDetails( | 453 ContentSettingsDetails details(ContentSettingsPattern(), |
| 452 ContentSettingsPattern(), CONTENT_SETTINGS_TYPE_DEFAULT, "")); | 454 CONTENT_SETTINGS_TYPE_DEFAULT, |
| 455 std::string()); |
| 456 NotifyObservers(details); |
| 453 } | 457 } |
| 454 } else if (type == NotificationType::PROFILE_DESTROYED) { | 458 } else if (type == NotificationType::PROFILE_DESTROYED) { |
| 455 DCHECK_EQ(profile_, Source<Profile>(source).ptr()); | 459 DCHECK_EQ(profile_, Source<Profile>(source).ptr()); |
| 456 UnregisterObservers(); | 460 UnregisterObservers(); |
| 457 } else { | 461 } else { |
| 458 NOTREACHED() << "Unexpected notification"; | 462 NOTREACHED() << "Unexpected notification"; |
| 459 } | 463 } |
| 460 } | 464 } |
| 461 | 465 |
| 462 } // namespace content_settings | 466 } // namespace content_settings |
| OLD | NEW |