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

Unified Diff: chrome/browser/permissions/permission_dialog_delegate.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/permissions/permission_dialog_delegate.cc
diff --git a/chrome/browser/permissions/permission_dialog_delegate.cc b/chrome/browser/permissions/permission_dialog_delegate.cc
index 5113aba03e7cbf54df9ab0c23aa5711d196b8512..52eb39d2e1a961ea0082555303422139254e5956 100644
--- a/chrome/browser/permissions/permission_dialog_delegate.cc
+++ b/chrome/browser/permissions/permission_dialog_delegate.cc
@@ -160,9 +160,9 @@ void PermissionDialogDelegate::CreateJavaDelegate(JNIEnv* env) {
ResourceMapper::MapFromChromiumId(
permission_prompt_->GetIconIdForPermission(0)),
ConvertUTF16ToJavaString(env, permission_prompt_->GetMessageText(0)),
- // TODO(timloh): Pass the actual link text for EME.
- ConvertUTF16ToJavaString(env, base::string16()), primaryButtonText,
- secondaryButtonText, permission_prompt_->ShouldShowPersistenceToggle()));
+ ConvertUTF16ToJavaString(env, permission_prompt_->GetLinkText()),
+ primaryButtonText, secondaryButtonText,
+ permission_prompt_->ShouldShowPersistenceToggle()));
}
void PermissionDialogDelegate::Accept(JNIEnv* env,
@@ -211,14 +211,11 @@ void PermissionDialogDelegate::LinkClicked(JNIEnv* env,
// InfoBarService as an owner() to open the link. That will fail since the
// wrapped delegate has no owner (it hasn't been added as an infobar).
if (tab_->web_contents()) {
- if (infobar_delegate_) {
- tab_->web_contents()->OpenURL(content::OpenURLParams(
- infobar_delegate_->GetLinkURL(), content::Referrer(),
- WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
- false));
- }
- // TODO(timloh): Show a 'learn more' link in the PermissionRequestManager
- // codepath for EME.
+ GURL linkURL = infobar_delegate_ ? infobar_delegate_->GetLinkURL()
+ : permission_prompt_->GetLinkURL();
+ tab_->web_contents()->OpenURL(content::OpenURLParams(
+ linkURL, content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB,
+ ui::PAGE_TRANSITION_LINK, false));
}
}

Powered by Google App Engine
This is Rietveld 408576698