Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: chrome/browser/permissions/grouped_permission_infobar_delegate_android.cc

Issue 2919323002: Support "learn more" link for EME in PermissionRequestManager code-path on Android (Closed)
Patch Set: address comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 permission_prompt_->Deny(); 81 permission_prompt_->Deny();
82 } 82 }
83 return true; 83 return true;
84 } 84 }
85 85
86 void GroupedPermissionInfoBarDelegate::InfoBarDismissed() { 86 void GroupedPermissionInfoBarDelegate::InfoBarDismissed() {
87 if (permission_prompt_) 87 if (permission_prompt_)
88 permission_prompt_->Closing(); 88 permission_prompt_->Closing();
89 } 89 }
90 90
91 base::string16 GroupedPermissionInfoBarDelegate::GetLinkText() const {
92 return permission_prompt_->GetLinkText();
93 }
94
91 GroupedPermissionInfoBarDelegate::GroupedPermissionInfoBarDelegate( 95 GroupedPermissionInfoBarDelegate::GroupedPermissionInfoBarDelegate(
92 PermissionPromptAndroid* permission_prompt, 96 PermissionPromptAndroid* permission_prompt,
93 const GURL& requesting_origin) 97 const GURL& requesting_origin)
94 : requesting_origin_(requesting_origin), 98 : requesting_origin_(requesting_origin),
95 persist_(true), 99 persist_(true),
96 permission_prompt_(permission_prompt) { 100 permission_prompt_(permission_prompt) {
97 DCHECK(permission_prompt); 101 DCHECK(permission_prompt);
98 } 102 }
99 103
100 infobars::InfoBarDelegate::InfoBarIdentifier 104 infobars::InfoBarDelegate::InfoBarIdentifier
(...skipping 18 matching lines...) Expand all
119 InfoBarButton button) const { 123 InfoBarButton button) const {
120 if (PermissionCount() > 1) { 124 if (PermissionCount() > 1) {
121 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_APP_OK 125 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_APP_OK
122 : IDS_APP_CANCEL); 126 : IDS_APP_CANCEL);
123 } 127 }
124 128
125 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_PERMISSION_ALLOW 129 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_PERMISSION_ALLOW
126 : IDS_PERMISSION_DENY); 130 : IDS_PERMISSION_DENY);
127 } 131 }
128 132
133 GURL GroupedPermissionInfoBarDelegate::GetLinkURL() const {
134 return permission_prompt_->GetLinkURL();
135 }
136
129 bool GroupedPermissionInfoBarDelegate::EqualsDelegate( 137 bool GroupedPermissionInfoBarDelegate::EqualsDelegate(
130 infobars::InfoBarDelegate* delegate) const { 138 infobars::InfoBarDelegate* delegate) const {
131 // The PermissionRequestManager doesn't create duplicate infobars so a pointer 139 // The PermissionRequestManager doesn't create duplicate infobars so a pointer
132 // equality check is sufficient. 140 // equality check is sufficient.
133 return this == delegate; 141 return this == delegate;
134 } 142 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698