| 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 #include "chrome/browser/ui/android/chrome_http_auth_handler.h" | 5 #include "chrome/browser/ui/android/chrome_http_auth_handler.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 : observer_(NULL), | 25 : observer_(NULL), |
| 26 explanation_(explanation) { | 26 explanation_(explanation) { |
| 27 } | 27 } |
| 28 | 28 |
| 29 ChromeHttpAuthHandler::~ChromeHttpAuthHandler() {} | 29 ChromeHttpAuthHandler::~ChromeHttpAuthHandler() {} |
| 30 | 30 |
| 31 void ChromeHttpAuthHandler::Init() { | 31 void ChromeHttpAuthHandler::Init() { |
| 32 DCHECK(java_chrome_http_auth_handler_.is_null()); | 32 DCHECK(java_chrome_http_auth_handler_.is_null()); |
| 33 JNIEnv* env = AttachCurrentThread(); | 33 JNIEnv* env = AttachCurrentThread(); |
| 34 java_chrome_http_auth_handler_.Reset( | 34 java_chrome_http_auth_handler_.Reset( |
| 35 Java_ChromeHttpAuthHandler_create(env, reinterpret_cast<jint>(this))); | 35 Java_ChromeHttpAuthHandler_create(env, reinterpret_cast<intptr_t>(this))); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void ChromeHttpAuthHandler::SetObserver(LoginHandler* observer) { | 38 void ChromeHttpAuthHandler::SetObserver(LoginHandler* observer) { |
| 39 observer_ = observer; | 39 observer_ = observer; |
| 40 } | 40 } |
| 41 | 41 |
| 42 jobject ChromeHttpAuthHandler::GetJavaObject() { | 42 jobject ChromeHttpAuthHandler::GetJavaObject() { |
| 43 return java_chrome_http_auth_handler_.obj(); | 43 return java_chrome_http_auth_handler_.obj(); |
| 44 } | 44 } |
| 45 | 45 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 ScopedJavaLocalRef<jstring> ChromeHttpAuthHandler::GetCancelButtonText( | 104 ScopedJavaLocalRef<jstring> ChromeHttpAuthHandler::GetCancelButtonText( |
| 105 JNIEnv* env, jobject) { | 105 JNIEnv* env, jobject) { |
| 106 return ConvertUTF16ToJavaString(env, l10n_util::GetStringUTF16(IDS_CANCEL)); | 106 return ConvertUTF16ToJavaString(env, l10n_util::GetStringUTF16(IDS_CANCEL)); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // static | 109 // static |
| 110 bool ChromeHttpAuthHandler::RegisterChromeHttpAuthHandler(JNIEnv* env) { | 110 bool ChromeHttpAuthHandler::RegisterChromeHttpAuthHandler(JNIEnv* env) { |
| 111 return RegisterNativesImpl(env); | 111 return RegisterNativesImpl(env); |
| 112 } | 112 } |
| OLD | NEW |