| 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_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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 // Migrate obsolete cookie prompt mode. | 346 // Migrate obsolete cookie prompt mode. |
| 347 if (ValueToContentSetting( | 347 if (ValueToContentSetting( |
| 348 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == | 348 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].get()) == |
| 349 CONTENT_SETTING_ASK) { | 349 CONTENT_SETTING_ASK) { |
| 350 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( | 350 default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( |
| 351 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); | 351 Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); |
| 352 } | 352 } |
| 353 | |
| 354 if (default_settings_[CONTENT_SETTINGS_TYPE_PLUGINS].get()) { | |
| 355 ContentSetting plugin_setting = ValueToContentSetting( | |
| 356 default_settings_[CONTENT_SETTINGS_TYPE_PLUGINS].get()); | |
| 357 plugin_setting = | |
| 358 ClickToPlayFixup(CONTENT_SETTINGS_TYPE_PLUGINS, plugin_setting); | |
| 359 default_settings_[CONTENT_SETTINGS_TYPE_PLUGINS].reset( | |
| 360 Value::CreateIntegerValue(plugin_setting)); | |
| 361 } | |
| 362 } | 353 } |
| 363 | 354 |
| 364 void DefaultProvider::MigrateObsoleteNotificationPref() { | 355 void DefaultProvider::MigrateObsoleteNotificationPref() { |
| 365 if (prefs_->HasPrefPath(prefs::kDesktopNotificationDefaultContentSetting)) { | 356 if (prefs_->HasPrefPath(prefs::kDesktopNotificationDefaultContentSetting)) { |
| 366 const base::Value* value = prefs_->FindPreference( | 357 const base::Value* value = prefs_->FindPreference( |
| 367 prefs::kDesktopNotificationDefaultContentSetting)->GetValue(); | 358 prefs::kDesktopNotificationDefaultContentSetting)->GetValue(); |
| 368 // Do not clear the old preference yet as long as we need to maintain | 359 // Do not clear the old preference yet as long as we need to maintain |
| 369 // backward compatibility. | 360 // backward compatibility. |
| 370 SetWebsiteSetting( | 361 SetWebsiteSetting( |
| 371 ContentSettingsPattern::Wildcard(), | 362 ContentSettingsPattern::Wildcard(), |
| (...skipping 14 matching lines...) Expand all Loading... |
| 386 SetWebsiteSetting( | 377 SetWebsiteSetting( |
| 387 ContentSettingsPattern::Wildcard(), | 378 ContentSettingsPattern::Wildcard(), |
| 388 ContentSettingsPattern::Wildcard(), | 379 ContentSettingsPattern::Wildcard(), |
| 389 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 380 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 390 std::string(), | 381 std::string(), |
| 391 value->DeepCopy()); | 382 value->DeepCopy()); |
| 392 } | 383 } |
| 393 } | 384 } |
| 394 | 385 |
| 395 } // namespace content_settings | 386 } // namespace content_settings |
| OLD | NEW |