| 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/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/content_settings/content_settings_utils.h" | 21 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 22 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
| 23 #include "chrome/browser/prefs/pref_service.h" | 23 #include "chrome/browser/prefs/pref_service.h" |
| 24 #include "chrome/common/chrome_notification_types.h" | 24 #include "chrome/common/chrome_notification_types.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/content_settings_pattern.h" | 26 #include "chrome/common/content_settings_pattern.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 29 #include "content/browser/browser_thread.h" | 29 #include "content/browser/browser_thread.h" |
| 30 #include "content/browser/user_metrics.h" | 30 #include "content/browser/user_metrics.h" |
| 31 #include "content/common/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
| 32 #include "content/public/browser/notification_source.h" | 32 #include "content/public/browser/notification_source.h" |
| 33 #include "content/public/common/content_switches.h" | 33 #include "content/public/common/content_switches.h" |
| 34 #include "googleurl/src/gurl.h" | 34 #include "googleurl/src/gurl.h" |
| 35 #include "net/base/net_errors.h" | 35 #include "net/base/net_errors.h" |
| 36 #include "net/base/static_cookie_policy.h" | 36 #include "net/base/static_cookie_policy.h" |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 // Returns true if we should allow all content types for this URL. This is | 40 // Returns true if we should allow all content types for this URL. This is |
| 41 // true for various internal objects like chrome:// URLs, so UI and other | 41 // true for various internal objects like chrome:// URLs, so UI and other |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 483 |
| 484 void HostContentSettingsMap::OnContentSettingChanged( | 484 void HostContentSettingsMap::OnContentSettingChanged( |
| 485 ContentSettingsPattern primary_pattern, | 485 ContentSettingsPattern primary_pattern, |
| 486 ContentSettingsPattern secondary_pattern, | 486 ContentSettingsPattern secondary_pattern, |
| 487 ContentSettingsType content_type, | 487 ContentSettingsType content_type, |
| 488 std::string resource_identifier) { | 488 std::string resource_identifier) { |
| 489 const ContentSettingsDetails details(primary_pattern, | 489 const ContentSettingsDetails details(primary_pattern, |
| 490 secondary_pattern, | 490 secondary_pattern, |
| 491 content_type, | 491 content_type, |
| 492 resource_identifier); | 492 resource_identifier); |
| 493 NotificationService::current()->Notify( | 493 content::NotificationService::current()->Notify( |
| 494 chrome::NOTIFICATION_CONTENT_SETTINGS_CHANGED, | 494 chrome::NOTIFICATION_CONTENT_SETTINGS_CHANGED, |
| 495 content::Source<HostContentSettingsMap>(this), | 495 content::Source<HostContentSettingsMap>(this), |
| 496 content::Details<const ContentSettingsDetails>(&details)); | 496 content::Details<const ContentSettingsDetails>(&details)); |
| 497 } | 497 } |
| 498 | 498 |
| 499 void HostContentSettingsMap::Observe( | 499 void HostContentSettingsMap::Observe( |
| 500 int type, | 500 int type, |
| 501 const content::NotificationSource& source, | 501 const content::NotificationSource& source, |
| 502 const content::NotificationDetails& details) { | 502 const content::NotificationDetails& details) { |
| 503 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 503 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 provider_type == DEFAULT_PROVIDER)) { | 585 provider_type == DEFAULT_PROVIDER)) { |
| 586 continue; | 586 continue; |
| 587 } | 587 } |
| 588 settings->push_back(PatternSettingSourceTuple( | 588 settings->push_back(PatternSettingSourceTuple( |
| 589 rule.primary_pattern, rule.secondary_pattern, | 589 rule.primary_pattern, rule.secondary_pattern, |
| 590 content_settings::ValueToContentSetting(rule.value.get()), | 590 content_settings::ValueToContentSetting(rule.value.get()), |
| 591 kProviderNames[provider_type], | 591 kProviderNames[provider_type], |
| 592 incognito)); | 592 incognito)); |
| 593 } | 593 } |
| 594 } | 594 } |
| OLD | NEW |