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

Unified Diff: chrome/browser/ui/android/infobars/infobar_container_android.cc

Issue 1107663003: Properly attach InfoBarContainer when it is swapped to a new WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2357
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/ui/android/infobars/infobar_container_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/infobars/infobar_container_android.cc
diff --git a/chrome/browser/ui/android/infobars/infobar_container_android.cc b/chrome/browser/ui/android/infobars/infobar_container_android.cc
index 08c844bfc7bc6dfe567c76a787946357337381dd..7e17d63e036009ef5361061c6745f962d53cc0ab 100644
--- a/chrome/browser/ui/android/infobars/infobar_container_android.cc
+++ b/chrome/browser/ui/android/infobars/infobar_container_android.cc
@@ -26,6 +26,14 @@ InfoBarContainerAndroid::~InfoBarContainerAndroid() {
RemoveAllInfoBarsForDestruction();
}
+void InfoBarContainerAndroid::SetWebContents(JNIEnv* env,
+ jobject obj,
+ jobject web_contents) {
+ InfoBarService* infobar_service = InfoBarService::FromWebContents(
+ content::WebContents::FromJavaWebContents(web_contents));
+ ChangeInfoBarManager(infobar_service);
+}
+
void InfoBarContainerAndroid::Destroy(JNIEnv* env, jobject obj) {
delete this;
}
@@ -74,14 +82,9 @@ void InfoBarContainerAndroid::PlatformSpecificRemoveInfoBar(
// Native JNI methods ---------------------------------------------------------
-static jlong Init(JNIEnv* env,
- jobject obj,
- jobject web_contents) {
+static jlong Init(JNIEnv* env, jobject obj) {
InfoBarContainerAndroid* infobar_container =
new InfoBarContainerAndroid(env, obj);
- InfoBarService* infobar_service = InfoBarService::FromWebContents(
- content::WebContents::FromJavaWebContents(web_contents));
- infobar_container->ChangeInfoBarManager(infobar_service);
return reinterpret_cast<intptr_t>(infobar_container);
}
« no previous file with comments | « chrome/browser/ui/android/infobars/infobar_container_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698