| 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 13 matching lines...) Expand all Loading... |
| 24 infobars::InfoBar* GroupedPermissionInfoBarDelegate::Create( | 24 infobars::InfoBar* GroupedPermissionInfoBarDelegate::Create( |
| 25 PermissionPromptAndroid* permission_prompt, | 25 PermissionPromptAndroid* permission_prompt, |
| 26 InfoBarService* infobar_service, | 26 InfoBarService* infobar_service, |
| 27 const GURL& requesting_origin) { | 27 const GURL& requesting_origin) { |
| 28 return infobar_service->AddInfoBar(base::MakeUnique<GroupedPermissionInfoBar>( | 28 return infobar_service->AddInfoBar(base::MakeUnique<GroupedPermissionInfoBar>( |
| 29 base::WrapUnique(new GroupedPermissionInfoBarDelegate( | 29 base::WrapUnique(new GroupedPermissionInfoBarDelegate( |
| 30 permission_prompt, requesting_origin)))); | 30 permission_prompt, requesting_origin)))); |
| 31 } | 31 } |
| 32 | 32 |
| 33 size_t GroupedPermissionInfoBarDelegate::PermissionCount() const { | 33 size_t GroupedPermissionInfoBarDelegate::PermissionCount() const { |
| 34 return permission_prompt_->permission_count(); | 34 return permission_prompt_->PermissionCount(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool GroupedPermissionInfoBarDelegate::ShouldShowPersistenceToggle() const { | 37 bool GroupedPermissionInfoBarDelegate::ShouldShowPersistenceToggle() const { |
| 38 return PermissionUtil::ShouldShowPersistenceToggle(); | 38 return PermissionUtil::ShouldShowPersistenceToggle(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 ContentSettingsType GroupedPermissionInfoBarDelegate::GetContentSettingType( | 41 ContentSettingsType GroupedPermissionInfoBarDelegate::GetContentSettingType( |
| 42 size_t position) const { | 42 size_t position) const { |
| 43 return permission_prompt_->GetContentSettingType(position); | 43 return permission_prompt_->GetContentSettingType(position); |
| 44 } | 44 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_PERMISSION_ALLOW | 120 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_PERMISSION_ALLOW |
| 121 : IDS_PERMISSION_DENY); | 121 : IDS_PERMISSION_DENY); |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool GroupedPermissionInfoBarDelegate::EqualsDelegate( | 124 bool GroupedPermissionInfoBarDelegate::EqualsDelegate( |
| 125 infobars::InfoBarDelegate* delegate) const { | 125 infobars::InfoBarDelegate* delegate) const { |
| 126 // The PermissionRequestManager doesn't create duplicate infobars so a pointer | 126 // The PermissionRequestManager doesn't create duplicate infobars so a pointer |
| 127 // equality check is sufficient. | 127 // equality check is sufficient. |
| 128 return this == delegate; | 128 return this == delegate; |
| 129 } | 129 } |
| OLD | NEW |