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

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

Issue 1481553002: jni: Pass method parameters as JavaParamRef in chrome/browser/ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 SetWebContents(JNIEnv* env,
28 void Destroy(JNIEnv* env, jobject obj); 28 const base::android::JavaParamRef<jobject>& obj,
29 const base::android::JavaParamRef<jobject>& web_contents);
30 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
29 31
30 JavaObjectWeakGlobalRef java_container() const { 32 JavaObjectWeakGlobalRef java_container() const {
31 return weak_java_infobar_container_; 33 return weak_java_infobar_container_;
32 } 34 }
33 35
34 private: 36 private:
35 ~InfoBarContainerAndroid() override; 37 ~InfoBarContainerAndroid() override;
36 38
37 // InfobarContainer: 39 // InfobarContainer:
38 void PlatformSpecificAddInfoBar(infobars::InfoBar* infobar, 40 void PlatformSpecificAddInfoBar(infobars::InfoBar* infobar,
(...skipping 10 matching lines...) Expand all
49 // us. 51 // us.
50 JavaObjectWeakGlobalRef weak_java_infobar_container_; 52 JavaObjectWeakGlobalRef weak_java_infobar_container_;
51 53
52 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerAndroid); 54 DISALLOW_COPY_AND_ASSIGN(InfoBarContainerAndroid);
53 }; 55 };
54 56
55 // Registers the InfoBarContainer's native methods through JNI. 57 // Registers the InfoBarContainer's native methods through JNI.
56 bool RegisterInfoBarContainer(JNIEnv* env); 58 bool RegisterInfoBarContainer(JNIEnv* env);
57 59
58 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_CONTAINER_ANDROID_H_ 60 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_CONTAINER_ANDROID_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/infobars/infobar_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