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

Side by Side Diff: android_webview/native/permission/aw_permission_request.h

Issue 1492703004: Pass method parameters as JavaParamRef in android_webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forgot to test compile unit tests before uploading, whoops 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 ANDROID_WEBVIEW_NATIVE_PERMISSION_AW_PERMISSION_REQUEST_H 5 #ifndef ANDROID_WEBVIEW_NATIVE_PERMISSION_AW_PERMISSION_REQUEST_H
6 #define ANDROID_WEBVIEW_NATIVE_PERMISSION_AW_PERMISSION_REQUEST_H 6 #define ANDROID_WEBVIEW_NATIVE_PERMISSION_AW_PERMISSION_REQUEST_H
7 7
8 #include "base/android/jni_weak_ref.h" 8 #include "base/android/jni_weak_ref.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 23 matching lines...) Expand all
34 // |weak_ptr|, which is owned by the returned java peer. 34 // |weak_ptr|, which is owned by the returned java peer.
35 static base::android::ScopedJavaLocalRef<jobject> Create( 35 static base::android::ScopedJavaLocalRef<jobject> Create(
36 scoped_ptr<AwPermissionRequestDelegate> delegate, 36 scoped_ptr<AwPermissionRequestDelegate> delegate,
37 base::WeakPtr<AwPermissionRequest>* weak_ptr); 37 base::WeakPtr<AwPermissionRequest>* weak_ptr);
38 38
39 // Return the Java peer. Must be null-checked. 39 // Return the Java peer. Must be null-checked.
40 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); 40 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
41 41
42 // Invoked by Java peer when request is processed, |granted| indicates the 42 // Invoked by Java peer when request is processed, |granted| indicates the
43 // request was granted or not. 43 // request was granted or not.
44 void OnAccept(JNIEnv* env, jobject jcaller, jboolean granted); 44 void OnAccept(JNIEnv* env,
45 void Destroy(JNIEnv* env, jobject obj); 45 const base::android::JavaParamRef<jobject>& jcaller,
46 jboolean granted);
47 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
46 48
47 // Return the origin which initiated the request. 49 // Return the origin which initiated the request.
48 const GURL& GetOrigin(); 50 const GURL& GetOrigin();
49 51
50 // Return the resources origin requested. 52 // Return the resources origin requested.
51 int64 GetResources(); 53 int64 GetResources();
52 54
53 // Cancel this request. Guarantee that 55 // Cancel this request. Guarantee that
54 // AwPermissionRequestDelegate::NotifyRequestResult will not be called after 56 // AwPermissionRequestDelegate::NotifyRequestResult will not be called after
55 // this call. This also deletes this object, so weak pointers are invalidated 57 // this call. This also deletes this object, so weak pointers are invalidated
(...skipping 17 matching lines...) Expand all
73 base::WeakPtrFactory<AwPermissionRequest> weak_factory_; 75 base::WeakPtrFactory<AwPermissionRequest> weak_factory_;
74 76
75 DISALLOW_COPY_AND_ASSIGN(AwPermissionRequest); 77 DISALLOW_COPY_AND_ASSIGN(AwPermissionRequest);
76 }; 78 };
77 79
78 bool RegisterAwPermissionRequest(JNIEnv* env); 80 bool RegisterAwPermissionRequest(JNIEnv* env);
79 81
80 } // namespace android_webivew 82 } // namespace android_webivew
81 83
82 #endif // ANDROID_WEBVIEW_NATIVE_PERMISSION_AW_PERMISSION_REQUEST_H 84 #endif // ANDROID_WEBVIEW_NATIVE_PERMISSION_AW_PERMISSION_REQUEST_H
OLDNEW
« no previous file with comments | « android_webview/native/aw_settings.cc ('k') | android_webview/native/permission/aw_permission_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698