OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/permissions/grouped_permission_infobar_delegate_android
.h" | 5 #include "chrome/browser/permissions/grouped_permission_infobar_delegate_android
.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "chrome/browser/android/android_theme_resources.h" | 8 #include "chrome/browser/android/android_theme_resources.h" |
9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
10 #include "chrome/browser/permissions/permission_prompt_android.h" | 10 #include "chrome/browser/permissions/permission_prompt_android.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 base::string16 GroupedPermissionInfoBarDelegate::GetButtonLabel( | 120 base::string16 GroupedPermissionInfoBarDelegate::GetButtonLabel( |
121 InfoBarButton button) const { | 121 InfoBarButton button) const { |
122 if (PermissionCount() > 1) { | 122 if (PermissionCount() > 1) { |
123 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_APP_OK | 123 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_APP_OK |
124 : IDS_APP_CANCEL); | 124 : IDS_APP_CANCEL); |
125 } | 125 } |
126 | 126 |
127 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_PERMISSION_ALLOW | 127 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_PERMISSION_ALLOW |
128 : IDS_PERMISSION_DENY); | 128 : IDS_PERMISSION_DENY); |
129 } | 129 } |
| 130 |
| 131 bool GroupedPermissionInfoBarDelegate::EqualsDelegate( |
| 132 infobars::InfoBarDelegate* delegate) const { |
| 133 // The PermissionRequestManager doesn't create duplicate infobars so a pointer |
| 134 // equality check is sufficient. |
| 135 return this == delegate; |
| 136 } |
OLD | NEW |