| 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/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/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 373 } |
| 374 | 374 |
| 375 void HostContentSettingsMap::UpdateLastUsageByPattern( | 375 void HostContentSettingsMap::UpdateLastUsageByPattern( |
| 376 const ContentSettingsPattern& primary_pattern, | 376 const ContentSettingsPattern& primary_pattern, |
| 377 const ContentSettingsPattern& secondary_pattern, | 377 const ContentSettingsPattern& secondary_pattern, |
| 378 ContentSettingsType content_type) { | 378 ContentSettingsType content_type) { |
| 379 UsedContentSettingsProviders(); | 379 UsedContentSettingsProviders(); |
| 380 | 380 |
| 381 GetPrefProvider()->UpdateLastUsage( | 381 GetPrefProvider()->UpdateLastUsage( |
| 382 primary_pattern, secondary_pattern, content_type); | 382 primary_pattern, secondary_pattern, content_type); |
| 383 |
| 384 FOR_EACH_OBSERVER( |
| 385 content_settings::Observer, |
| 386 observers_, |
| 387 OnContentSettingUsed(primary_pattern, secondary_pattern, content_type)); |
| 383 } | 388 } |
| 384 | 389 |
| 385 base::Time HostContentSettingsMap::GetLastUsage( | 390 base::Time HostContentSettingsMap::GetLastUsage( |
| 386 const GURL& primary_url, | 391 const GURL& primary_url, |
| 387 const GURL& secondary_url, | 392 const GURL& secondary_url, |
| 388 ContentSettingsType content_type) { | 393 ContentSettingsType content_type) { |
| 389 return GetLastUsageByPattern( | 394 return GetLastUsageByPattern( |
| 390 ContentSettingsPattern::FromURLNoWildcard(primary_url), | 395 ContentSettingsPattern::FromURLNoWildcard(primary_url), |
| 391 ContentSettingsPattern::FromURLNoWildcard(secondary_url), | 396 ContentSettingsPattern::FromURLNoWildcard(secondary_url), |
| 392 content_type); | 397 content_type); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 } | 751 } |
| 747 | 752 |
| 748 NOTREACHED(); | 753 NOTREACHED(); |
| 749 return DEFAULT_PROVIDER; | 754 return DEFAULT_PROVIDER; |
| 750 } | 755 } |
| 751 | 756 |
| 752 content_settings::PrefProvider* HostContentSettingsMap::GetPrefProvider() { | 757 content_settings::PrefProvider* HostContentSettingsMap::GetPrefProvider() { |
| 753 return static_cast<content_settings::PrefProvider*>( | 758 return static_cast<content_settings::PrefProvider*>( |
| 754 content_settings_providers_[PREF_PROVIDER]); | 759 content_settings_providers_[PREF_PROVIDER]); |
| 755 } | 760 } |
| OLD | NEW |