| OLD | NEW |
| 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 CHROME_BROWSER_UI_ANDROID_CHROME_HTTP_AUTH_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_CHROME_HTTP_AUTH_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_CHROME_HTTP_AUTH_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_CHROME_HTTP_AUTH_HANDLER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // Forwards the autofill data to the Java land object. | 34 // Forwards the autofill data to the Java land object. |
| 35 void OnAutofillDataAvailable( | 35 void OnAutofillDataAvailable( |
| 36 const base::string16& username, | 36 const base::string16& username, |
| 37 const base::string16& password); | 37 const base::string16& password); |
| 38 | 38 |
| 39 // -------------------------------------------------------------- | 39 // -------------------------------------------------------------- |
| 40 // JNI Methods | 40 // JNI Methods |
| 41 // -------------------------------------------------------------- | 41 // -------------------------------------------------------------- |
| 42 | 42 |
| 43 // Submits the username and password to the observer. | 43 // Submits the username and password to the observer. |
| 44 void SetAuth(JNIEnv* env, jobject, jstring username, jstring password); | 44 void SetAuth(JNIEnv* env, |
| 45 const base::android::JavaParamRef<jobject>&, |
| 46 const base::android::JavaParamRef<jstring>& username, |
| 47 const base::android::JavaParamRef<jstring>& password); |
| 45 | 48 |
| 46 // Cancels the authentication attempt of the observer. | 49 // Cancels the authentication attempt of the observer. |
| 47 void CancelAuth(JNIEnv* env, jobject); | 50 void CancelAuth(JNIEnv* env, const base::android::JavaParamRef<jobject>&); |
| 48 | 51 |
| 49 // These functions return the strings needed to display a login form. | 52 // These functions return the strings needed to display a login form. |
| 50 base::android::ScopedJavaLocalRef<jstring> GetMessageBody( | 53 base::android::ScopedJavaLocalRef<jstring> GetMessageBody( |
| 51 JNIEnv* env, jobject); | 54 JNIEnv* env, |
| 55 const base::android::JavaParamRef<jobject>&); |
| 52 // Registers the ChromeHttpAuthHandler native methods. | 56 // Registers the ChromeHttpAuthHandler native methods. |
| 53 static bool RegisterChromeHttpAuthHandler(JNIEnv* env); | 57 static bool RegisterChromeHttpAuthHandler(JNIEnv* env); |
| 54 private: | 58 private: |
| 55 LoginHandler* observer_; | 59 LoginHandler* observer_; |
| 56 base::android::ScopedJavaGlobalRef<jobject> java_chrome_http_auth_handler_; | 60 base::android::ScopedJavaGlobalRef<jobject> java_chrome_http_auth_handler_; |
| 57 // e.g. "The server example.com:80 requires a username and password." | 61 // e.g. "The server example.com:80 requires a username and password." |
| 58 base::string16 explanation_; | 62 base::string16 explanation_; |
| 59 | 63 |
| 60 DISALLOW_COPY_AND_ASSIGN(ChromeHttpAuthHandler); | 64 DISALLOW_COPY_AND_ASSIGN(ChromeHttpAuthHandler); |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 #endif // CHROME_BROWSER_UI_ANDROID_CHROME_HTTP_AUTH_HANDLER_H_ | 67 #endif // CHROME_BROWSER_UI_ANDROID_CHROME_HTTP_AUTH_HANDLER_H_ |
| OLD | NEW |