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

Unified Diff: chrome/browser/ui/android/infobar/infobar_container_android.h

Issue 24109002: [InfoBar] Upstram basic infobar flow for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@upstream_infobar_full
Patch Set: Fix License header in two more files Created 7 years, 3 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/ui/android/infobar/infobar_container_android.h
diff --git a/chrome/browser/ui/android/infobar/infobar_container_android.h b/chrome/browser/ui/android/infobar/infobar_container_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb61ffa173b1f73f56911971599fcfe60d157dca
--- /dev/null
+++ b/chrome/browser/ui/android/infobar/infobar_container_android.h
@@ -0,0 +1,69 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_ANDROID_INFOBAR_INFOBAR_CONTAINER_ANDROID_H_
+#define CHROME_BROWSER_UI_ANDROID_INFOBAR_INFOBAR_CONTAINER_ANDROID_H_
+
+#include <map>
+#include <string>
+
+#include "base/android/jni_helper.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "chrome/browser/infobars/infobar_container.h"
+
+class InfoBarAndroid;
+class InfoBarDelegate;
+class InfoBarService;
+
+namespace content {
+class WebContents;
+}
+
+class InfoBarContainerAndroid : public InfoBarContainer {
+ public:
+ InfoBarContainerAndroid(JNIEnv* env,
+ jobject infobar_container,
+ jobject auto_login_delegate);
+ void Destroy(JNIEnv* env, jobject obj);
+
+ JavaObjectWeakGlobalRef auto_login_delegate() const {
+ return weak_java_auto_login_delegate_;
+ }
+
+ JavaObjectWeakGlobalRef java_container() const {
+ return weak_java_infobar_container_;
+ }
+
+ // The prerender is swapping the web contents.
+ void OnWebContentsReplaced(content::WebContents* old_web_contents,
+ content::WebContents* new_web_contents);
+
+ private:
+ virtual ~InfoBarContainerAndroid() OVERRIDE;
+
+ // InfobarContainer
+ virtual void PlatformSpecificAddInfoBar(InfoBar* infobar, size_t position)
+ OVERRIDE;
+ virtual void PlatformSpecificRemoveInfoBar(InfoBar* infobar) OVERRIDE;
+ virtual void PlatformSpecificReplaceInfoBar(InfoBar* old_infobar,
+ InfoBar* new_infobar) OVERRIDE;
+
+ // Create the Java equivalent of |android_bar| and add it to the java
+ // container
+ void AttachJavaInfoBar(InfoBarAndroid* android_bar);
+
+ // We're owned by the java infobar, need to use a weak ref so it can destroy
+ // us.
+ JavaObjectWeakGlobalRef weak_java_infobar_container_;
+ JavaObjectWeakGlobalRef weak_java_auto_login_delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(InfoBarContainerAndroid);
+};
+
+// Register the InfoBarContainer's native methods through jni
+bool RegisterInfoBarContainer(JNIEnv* env);
+
+#endif // CHROME_BROWSER_UI_ANDROID_INFOBAR_INFOBAR_CONTAINER_ANDROID_H_
« no previous file with comments | « chrome/browser/ui/android/infobar/infobar_android.cc ('k') | chrome/browser/ui/android/infobar/infobar_container_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698