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/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #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" | 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" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 ContentSetting DesktopNotificationProfileUtil::GetContentSetting( | 63 ContentSetting DesktopNotificationProfileUtil::GetContentSetting( |
64 Profile* profile, const GURL& origin) { | 64 Profile* profile, const GURL& origin) { |
65 return profile->GetHostContentSettingsMap()->GetContentSetting( | 65 return profile->GetHostContentSettingsMap()->GetContentSetting( |
66 origin, | 66 origin, |
67 origin, | 67 origin, |
68 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 68 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
69 NO_RESOURCE_IDENTIFIER); | 69 NO_RESOURCE_IDENTIFIER); |
70 } | 70 } |
71 | |
72 void DesktopNotificationProfileUtil::UsePermission(Profile* profile, | |
73 const GURL& origin) { | |
74 profile->GetHostContentSettingsMap()->UpdateLastUsageByPattern( | |
75 ContentSettingsPattern::FromURLNoWildcard(origin), | |
76 ContentSettingsPattern::Wildcard(), | |
77 CONTENT_SETTINGS_TYPE_NOTIFICATIONS); | |
78 } | |
OLD | NEW |