| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/notifications/desktop_notification_profile_util.h" | 5 #include "chrome/browser/notifications/desktop_notification_profile_util.h" |
| 6 | 6 |
| 7 #include "chrome/browser/content_settings/host_content_settings_map.h" | |
| 8 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 9 #include "components/content_settings/core/browser/content_settings_provider.h" | 8 #include "components/content_settings/core/browser/content_settings_provider.h" |
| 9 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 10 #include "components/content_settings/core/common/content_settings_pattern.h" | 10 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 11 | 11 |
| 12 void DesktopNotificationProfileUtil::ResetToDefaultContentSetting( | 12 void DesktopNotificationProfileUtil::ResetToDefaultContentSetting( |
| 13 Profile* profile) { | 13 Profile* profile) { |
| 14 profile->GetHostContentSettingsMap()->SetDefaultContentSetting( | 14 profile->GetHostContentSettingsMap()->SetDefaultContentSetting( |
| 15 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTING_DEFAULT); | 15 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTING_DEFAULT); |
| 16 } | 16 } |
| 17 | 17 |
| 18 // Clears the notifications setting for the given pattern. | 18 // Clears the notifications setting for the given pattern. |
| 19 void DesktopNotificationProfileUtil::ClearSetting( | 19 void DesktopNotificationProfileUtil::ClearSetting( |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 NO_RESOURCE_IDENTIFIER); | 69 NO_RESOURCE_IDENTIFIER); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void DesktopNotificationProfileUtil::UsePermission(Profile* profile, | 72 void DesktopNotificationProfileUtil::UsePermission(Profile* profile, |
| 73 const GURL& origin) { | 73 const GURL& origin) { |
| 74 profile->GetHostContentSettingsMap()->UpdateLastUsageByPattern( | 74 profile->GetHostContentSettingsMap()->UpdateLastUsageByPattern( |
| 75 ContentSettingsPattern::FromURLNoWildcard(origin), | 75 ContentSettingsPattern::FromURLNoWildcard(origin), |
| 76 ContentSettingsPattern::Wildcard(), | 76 ContentSettingsPattern::Wildcard(), |
| 77 CONTENT_SETTINGS_TYPE_NOTIFICATIONS); | 77 CONTENT_SETTINGS_TYPE_NOTIFICATIONS); |
| 78 } | 78 } |
| OLD | NEW |