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