| Index: chrome/browser/ui/android/infobars/confirm_infobar.cc
|
| diff --git a/chrome/browser/ui/android/infobars/confirm_infobar.cc b/chrome/browser/ui/android/infobars/confirm_infobar.cc
|
| index d5ffed45186d94c9a16668327678a0e8425d05aa..cf6e76693dc5af85ecb0a514f8ba2205f1b298c7 100644
|
| --- a/chrome/browser/ui/android/infobars/confirm_infobar.cc
|
| +++ b/chrome/browser/ui/android/infobars/confirm_infobar.cc
|
| @@ -9,9 +9,9 @@
|
|
|
| #include "base/android/jni_string.h"
|
| #include "base/memory/ptr_util.h"
|
| +#include "chrome/browser/android/tab_android.h"
|
| #include "chrome/browser/infobars/infobar_service.h"
|
| #include "components/infobars/core/confirm_infobar_delegate.h"
|
| -#include "content/public/browser/android/content_view_core.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "jni/ConfirmInfoBar_jni.h"
|
| #include "ui/android/window_android.h"
|
| @@ -37,6 +37,27 @@ ConfirmInfoBar::ConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate> delegate)
|
| ConfirmInfoBar::~ConfirmInfoBar() {
|
| }
|
|
|
| +base::string16 ConfirmInfoBar::GetTextFor(
|
| + ConfirmInfoBarDelegate::InfoBarButton button) {
|
| + ConfirmInfoBarDelegate* delegate = GetDelegate();
|
| + return (delegate->GetButtons() & button) ?
|
| + delegate->GetButtonLabel(button) : base::string16();
|
| +}
|
| +
|
| +ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() {
|
| + return delegate()->AsConfirmInfoBarDelegate();
|
| +}
|
| +
|
| +TabAndroid* ConfirmInfoBar::GetTab() {
|
| + content::WebContents* web_contents =
|
| + InfoBarService::WebContentsFromInfoBar(this);
|
| + DCHECK(web_contents);
|
| +
|
| + TabAndroid* tab = TabAndroid::FromWebContents(web_contents);
|
| + DCHECK(tab);
|
| + return tab;
|
| +}
|
| +
|
| ScopedJavaLocalRef<jobject> ConfirmInfoBar::CreateRenderInfoBar(JNIEnv* env) {
|
| ScopedJavaLocalRef<jstring> ok_button_text =
|
| base::android::ConvertUTF16ToJavaString(
|
| @@ -61,16 +82,6 @@ ScopedJavaLocalRef<jobject> ConfirmInfoBar::CreateRenderInfoBar(JNIEnv* env) {
|
| cancel_button_text);
|
| }
|
|
|
| -ScopedJavaLocalRef<jobject> ConfirmInfoBar::GetWindowAndroid() {
|
| - content::WebContents* web_contents =
|
| - InfoBarService::WebContentsFromInfoBar(this);
|
| - DCHECK(web_contents);
|
| - content::ContentViewCore* cvc =
|
| - content::ContentViewCore::FromWebContents(web_contents);
|
| - DCHECK(cvc);
|
| - return cvc->GetWindowAndroid()->GetJavaObject();
|
| -}
|
| -
|
| void ConfirmInfoBar::OnLinkClicked(JNIEnv* env,
|
| const JavaParamRef<jobject>& obj) {
|
| if (!owner())
|
| @@ -91,14 +102,3 @@ void ConfirmInfoBar::ProcessButton(int action) {
|
| delegate->Accept() : delegate->Cancel())
|
| RemoveSelf();
|
| }
|
| -
|
| -ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() {
|
| - return delegate()->AsConfirmInfoBarDelegate();
|
| -}
|
| -
|
| -base::string16 ConfirmInfoBar::GetTextFor(
|
| - ConfirmInfoBarDelegate::InfoBarButton button) {
|
| - ConfirmInfoBarDelegate* delegate = GetDelegate();
|
| - return (delegate->GetButtons() & button) ?
|
| - delegate->GetButtonLabel(button) : base::string16();
|
| -}
|
|
|