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

Side by Side Diff: chrome/browser/ui/android/infobars/infobar_container_android.h

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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_CONTAINER_ANDROID_H_ 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_CONTAINER_ANDROID_H_
6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_CONTAINER_ANDROID_H_ 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_CONTAINER_ANDROID_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/android/jni_weak_ref.h" 11 #include "base/android/jni_weak_ref.h"
12 #include "base/android/scoped_java_ref.h" 12 #include "base/android/scoped_java_ref.h"
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "components/infobars/core/infobar_container.h" 15 #include "components/infobars/core/infobar_container.h"
16 16
17 class InfoBarAndroid; 17 class InfoBarAndroid;
18 18
19 namespace content { 19 namespace content {
20 class WebContents; 20 class WebContents;
21 } 21 }
22 22
23 class InfoBarContainerAndroid : public infobars::InfoBarContainer { 23 class InfoBarContainerAndroid : public infobars::InfoBarContainer {
24 public: 24 public:
25 InfoBarContainerAndroid(JNIEnv* env, 25 InfoBarContainerAndroid(JNIEnv* env,
26 jobject infobar_container); 26 jobject infobar_container);
27 void SetWebContents(JNIEnv* env, jobject obj, jobject web_contents);
27 void Destroy(JNIEnv* env, jobject obj); 28 void Destroy(JNIEnv* env, jobject obj);
28 29
29 JavaObjectWeakGlobalRef java_container() const { 30 JavaObjectWeakGlobalRef java_container() const {
30 return weak_java_infobar_container_; 31 return weak_java_infobar_container_;
31 } 32 }
32 33
33 private: 34 private:
34 ~InfoBarContainerAndroid() override; 35 ~InfoBarContainerAndroid() override;
35 36
36 // InfobarContainer: 37 // InfobarContainer:
(...skipping 11 matching lines...) Expand all
48 // us. 49 // us.
49 JavaObjectWeakGlobalRef weak_java_infobar_container_; 50 JavaObjectWeakGlobalRef weak_java_infobar_container_;
50 51
51 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerAndroid); 52 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerAndroid);
52 }; 53 };
53 54
54 // Registers the InfoBarContainer's native methods through JNI. 55 // Registers the InfoBarContainer's native methods through JNI.
55 bool RegisterInfoBarContainer(JNIEnv* env); 56 bool RegisterInfoBarContainer(JNIEnv* env);
56 57
57 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_CONTAINER_ANDROID_H_ 58 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_CONTAINER_ANDROID_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_android.cc ('k') | chrome/browser/ui/android/infobars/infobar_container_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698