| 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/notification_permission_infobar_delegate.
h" | 5 #include "chrome/browser/notifications/notification_permission_infobar_delegate.
h" |
| 6 | 6 |
| 7 #include "chrome/browser/android/android_theme_resources.h" | 7 #include "chrome/browser/android/android_theme_resources.h" |
| 8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 | 9 |
| 10 NotificationPermissionInfoBarDelegate::NotificationPermissionInfoBarDelegate( | 10 NotificationPermissionInfoBarDelegate::NotificationPermissionInfoBarDelegate( |
| 11 const content::PermissionType& permission_type, |
| 11 const GURL& requesting_frame, | 12 const GURL& requesting_frame, |
| 12 bool user_gesture, | 13 bool user_gesture, |
| 13 Profile* profile, | 14 Profile* profile, |
| 14 const PermissionSetCallback& callback) | 15 const PermissionSetCallback& callback) |
| 15 : PermissionInfoBarDelegate(requesting_frame, | 16 : PermissionInfoBarDelegate(requesting_frame, |
| 16 content::PermissionType::NOTIFICATIONS, | 17 permission_type, |
| 17 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 18 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
| 18 user_gesture, | 19 user_gesture, |
| 19 profile, | 20 profile, |
| 20 callback) {} | 21 callback) { |
| 22 DCHECK(permission_type == content::PermissionType::NOTIFICATIONS || |
| 23 permission_type == content::PermissionType::PUSH_MESSAGING); |
| 24 } |
| 21 | 25 |
| 22 NotificationPermissionInfoBarDelegate::~NotificationPermissionInfoBarDelegate() | 26 NotificationPermissionInfoBarDelegate::~NotificationPermissionInfoBarDelegate() |
| 23 {} | 27 {} |
| 24 | 28 |
| 25 infobars::InfoBarDelegate::InfoBarIdentifier | 29 infobars::InfoBarDelegate::InfoBarIdentifier |
| 26 NotificationPermissionInfoBarDelegate::GetIdentifier() const { | 30 NotificationPermissionInfoBarDelegate::GetIdentifier() const { |
| 27 return NOTIFICATION_PERMISSION_INFOBAR_DELEGATE; | 31 return NOTIFICATION_PERMISSION_INFOBAR_DELEGATE; |
| 28 } | 32 } |
| 29 | 33 |
| 30 int NotificationPermissionInfoBarDelegate::GetIconId() const { | 34 int NotificationPermissionInfoBarDelegate::GetIconId() const { |
| 31 return IDR_ANDROID_INFOBAR_NOTIFICATIONS; | 35 return IDR_ANDROID_INFOBAR_NOTIFICATIONS; |
| 32 } | 36 } |
| 33 | 37 |
| 34 int NotificationPermissionInfoBarDelegate::GetMessageResourceId() const { | 38 int NotificationPermissionInfoBarDelegate::GetMessageResourceId() const { |
| 35 return IDS_NOTIFICATION_PERMISSIONS; | 39 return IDS_NOTIFICATION_PERMISSIONS; |
| 36 } | 40 } |
| OLD | NEW |