| 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/services/gcm/push_messaging_permission_context.h" | 5 #include "chrome/browser/push_messaging/push_messaging_permission_context.h" |
| 6 | 6 |
| 7 #include "chrome/browser/content_settings/permission_context_uma_util.h" | 7 #include "chrome/browser/content_settings/permission_context_uma_util.h" |
| 8 #include "chrome/browser/notifications/desktop_notification_service.h" | 8 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 9 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 9 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "components/content_settings/core/browser/host_content_settings_map.h" | 11 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 12 #include "components/content_settings/core/common/permission_request_id.h" | 12 #include "components/content_settings/core/common/permission_request_id.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "content/public/browser/web_contents_delegate.h" | 15 #include "content/public/browser/web_contents_delegate.h" |
| 16 | 16 |
| 17 const ContentSettingsType kPushSettingType = | 17 const ContentSettingsType kPushSettingType = |
| 18 CONTENT_SETTINGS_TYPE_PUSH_MESSAGING; | 18 CONTENT_SETTINGS_TYPE_PUSH_MESSAGING; |
| 19 | 19 |
| 20 namespace gcm { | |
| 21 | |
| 22 PushMessagingPermissionContext::PushMessagingPermissionContext(Profile* profile) | 20 PushMessagingPermissionContext::PushMessagingPermissionContext(Profile* profile) |
| 23 : PermissionContextBase(profile, CONTENT_SETTINGS_TYPE_PUSH_MESSAGING), | 21 : PermissionContextBase(profile, CONTENT_SETTINGS_TYPE_PUSH_MESSAGING), |
| 24 profile_(profile), | 22 profile_(profile), |
| 25 weak_factory_ui_thread_(this) { | 23 weak_factory_ui_thread_(this) { |
| 26 } | 24 } |
| 27 | 25 |
| 28 PushMessagingPermissionContext::~PushMessagingPermissionContext() { | 26 PushMessagingPermissionContext::~PushMessagingPermissionContext() { |
| 29 } | 27 } |
| 30 | 28 |
| 31 ContentSetting PushMessagingPermissionContext::GetPermissionStatus( | 29 ContentSetting PushMessagingPermissionContext::GetPermissionStatus( |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 129 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 132 false /* persist */, notification_content_setting); | 130 false /* persist */, notification_content_setting); |
| 133 return; | 131 return; |
| 134 } | 132 } |
| 135 | 133 |
| 136 PermissionContextUmaUtil::PermissionGranted(kPushSettingType, | 134 PermissionContextUmaUtil::PermissionGranted(kPushSettingType, |
| 137 requesting_origin); | 135 requesting_origin); |
| 138 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, | 136 NotifyPermissionSet(id, requesting_origin, embedding_origin, callback, |
| 139 true /* persist */, CONTENT_SETTING_ALLOW); | 137 true /* persist */, CONTENT_SETTING_ALLOW); |
| 140 } | 138 } |
| 141 } // namespace gcm | |
| 142 | |
| OLD | NEW |