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_pref_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_pref_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 resource_identifier, &setting); | 354 resource_identifier, &setting); |
355 DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); | 355 DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); |
356 value_map_.SetValue(pattern_pair.first, | 356 value_map_.SetValue(pattern_pair.first, |
357 pattern_pair.second, | 357 pattern_pair.second, |
358 content_type, | 358 content_type, |
359 resource_identifier, | 359 resource_identifier, |
360 Value::CreateIntegerValue(setting)); | 360 Value::CreateIntegerValue(setting)); |
361 } | 361 } |
362 } | 362 } |
363 } | 363 } |
364 int setting = CONTENT_SETTING_DEFAULT; | 364 if (content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) { |
365 if (settings_dictionary->GetIntegerWithoutPathExpansion( | 365 // MediaStream is using compound type as value. |
366 GetTypeName(ContentSettingsType(i)), &setting)) { | 366 DictionaryValue* setting = NULL; |
367 DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); | 367 if (settings_dictionary->GetDictionaryWithoutPathExpansion( |
368 setting = FixObsoleteCookiePromptMode(content_type, | 368 GetTypeName(ContentSettingsType(i)), &setting)) { |
369 ContentSetting(setting)); | 369 DCHECK(!setting->empty()); |
370 value_map_.SetValue(pattern_pair.first, | 370 value_map_.SetValue(pattern_pair.first, |
371 pattern_pair.second, | 371 pattern_pair.second, |
372 content_type, | 372 content_type, |
373 ResourceIdentifier(""), | 373 ResourceIdentifier(""), |
374 Value::CreateIntegerValue(setting)); | 374 setting); |
| 375 } |
| 376 } else { |
| 377 int setting = CONTENT_SETTING_DEFAULT; |
| 378 if (settings_dictionary->GetIntegerWithoutPathExpansion( |
| 379 GetTypeName(ContentSettingsType(i)), &setting)) { |
| 380 DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); |
| 381 setting = FixObsoleteCookiePromptMode(content_type, |
| 382 ContentSetting(setting)); |
| 383 value_map_.SetValue(pattern_pair.first, |
| 384 pattern_pair.second, |
| 385 content_type, |
| 386 ResourceIdentifier(""), |
| 387 Value::CreateIntegerValue(setting)); |
| 388 } |
375 } | 389 } |
376 } | 390 } |
377 } | 391 } |
378 } | 392 } |
379 | 393 |
380 void PrefProvider::UpdatePatternPairsSettings( | 394 void PrefProvider::UpdatePatternPairsSettings( |
381 const ContentSettingsPattern& primary_pattern, | 395 const ContentSettingsPattern& primary_pattern, |
382 const ContentSettingsPattern& secondary_pattern, | 396 const ContentSettingsPattern& secondary_pattern, |
383 ContentSettingsType content_type, | 397 ContentSettingsType content_type, |
384 const ResourceIdentifier& resource_identifier, | 398 const ResourceIdentifier& resource_identifier, |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 | 697 |
684 void PrefProvider::AssertLockNotHeld() const { | 698 void PrefProvider::AssertLockNotHeld() const { |
685 #if !defined(NDEBUG) | 699 #if !defined(NDEBUG) |
686 // |Lock::Acquire()| will assert if the lock is held by this thread. | 700 // |Lock::Acquire()| will assert if the lock is held by this thread. |
687 lock_.Acquire(); | 701 lock_.Acquire(); |
688 lock_.Release(); | 702 lock_.Release(); |
689 #endif | 703 #endif |
690 } | 704 } |
691 | 705 |
692 } // namespace content_settings | 706 } // namespace content_settings |
OLD | NEW |