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

Side by Side Diff: content/browser/android/interstitial_page_delegate_android.h

Issue 1489453003: jni: Pass method parameters as JavaParamRef in content. (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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_ANDROID_INTERSTITIAL_PAGE_DELEGATE_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_INTERSTITIAL_PAGE_DELEGATE_ANDROID_H_
6 #define CONTENT_BROWSER_ANDROID_INTERSTITIAL_PAGE_DELEGATE_ANDROID_H_ 6 #define CONTENT_BROWSER_ANDROID_INTERSTITIAL_PAGE_DELEGATE_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 13 matching lines...) Expand all
24 class InterstitialPageDelegateAndroid : public InterstitialPageDelegate { 24 class InterstitialPageDelegateAndroid : public InterstitialPageDelegate {
25 public: 25 public:
26 InterstitialPageDelegateAndroid(JNIEnv* env, 26 InterstitialPageDelegateAndroid(JNIEnv* env,
27 jobject obj, 27 jobject obj,
28 const std::string& html_content); 28 const std::string& html_content);
29 ~InterstitialPageDelegateAndroid() override; 29 ~InterstitialPageDelegateAndroid() override;
30 30
31 void set_interstitial_page(InterstitialPage* page) { page_ = page; } 31 void set_interstitial_page(InterstitialPage* page) { page_ = page; }
32 32
33 // Methods called from Java. 33 // Methods called from Java.
34 void Proceed(JNIEnv* env, jobject obj); 34 void Proceed(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
35 void DontProceed(JNIEnv* env, jobject obj); 35 void DontProceed(JNIEnv* env,
36 const base::android::JavaParamRef<jobject>& obj);
36 37
37 // Implementation of InterstitialPageDelegate 38 // Implementation of InterstitialPageDelegate
38 std::string GetHTMLContents() override; 39 std::string GetHTMLContents() override;
39 void OnProceed() override; 40 void OnProceed() override;
40 void OnDontProceed() override; 41 void OnDontProceed() override;
41 void CommandReceived(const std::string& command) override; 42 void CommandReceived(const std::string& command) override;
42 43
43 static bool RegisterInterstitialPageDelegateAndroid(JNIEnv* env); 44 static bool RegisterInterstitialPageDelegateAndroid(JNIEnv* env);
44 45
45 private: 46 private:
46 JavaObjectWeakGlobalRef weak_java_obj_; 47 JavaObjectWeakGlobalRef weak_java_obj_;
47 48
48 std::string html_content_; 49 std::string html_content_;
49 InterstitialPage* page_; // Owns this. 50 InterstitialPage* page_; // Owns this.
50 51
51 DISALLOW_COPY_AND_ASSIGN(InterstitialPageDelegateAndroid); 52 DISALLOW_COPY_AND_ASSIGN(InterstitialPageDelegateAndroid);
52 }; 53 };
53 54
54 } // namespace content 55 } // namespace content
55 56
56 #endif // CONTENT_BROWSER_ANDROID_INTERSTITIAL_PAGE_DELEGATE_ANDROID_H_ 57 #endif // CONTENT_BROWSER_ANDROID_INTERSTITIAL_PAGE_DELEGATE_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698