| 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 "components/web_contents_delegate_android/web_contents_delegate_android
.h" | 5 #include "components/web_contents_delegate_android/web_contents_delegate_android
.h" |
| 6 | 6 |
| 7 #include <android/keycodes.h> | 7 #include <android/keycodes.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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 | 178 |
| 179 void WebContentsDelegateAndroid::MoveContents(WebContents* source, | 179 void WebContentsDelegateAndroid::MoveContents(WebContents* source, |
| 180 const gfx::Rect& pos) { | 180 const gfx::Rect& pos) { |
| 181 // Do nothing. | 181 // Do nothing. |
| 182 } | 182 } |
| 183 | 183 |
| 184 bool WebContentsDelegateAndroid::AddMessageToConsole( | 184 bool WebContentsDelegateAndroid::AddMessageToConsole( |
| 185 WebContents* source, | 185 WebContents* source, |
| 186 int32 level, | 186 int32 level, |
| 187 const string16& message, | 187 const base::string16& message, |
| 188 int32 line_no, | 188 int32 line_no, |
| 189 const string16& source_id) { | 189 const base::string16& source_id) { |
| 190 JNIEnv* env = AttachCurrentThread(); | 190 JNIEnv* env = AttachCurrentThread(); |
| 191 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 191 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 192 if (obj.is_null()) | 192 if (obj.is_null()) |
| 193 return WebContentsDelegate::AddMessageToConsole(source, level, message, | 193 return WebContentsDelegate::AddMessageToConsole(source, level, message, |
| 194 line_no, source_id); | 194 line_no, source_id); |
| 195 ScopedJavaLocalRef<jstring> jmessage(ConvertUTF16ToJavaString(env, message)); | 195 ScopedJavaLocalRef<jstring> jmessage(ConvertUTF16ToJavaString(env, message)); |
| 196 ScopedJavaLocalRef<jstring> jsource_id( | 196 ScopedJavaLocalRef<jstring> jsource_id( |
| 197 ConvertUTF16ToJavaString(env, source_id)); | 197 ConvertUTF16ToJavaString(env, source_id)); |
| 198 int jlevel = WEB_CONTENTS_DELEGATE_LOG_LEVEL_DEBUG; | 198 int jlevel = WEB_CONTENTS_DELEGATE_LOG_LEVEL_DEBUG; |
| 199 switch (level) { | 199 switch (level) { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { | 309 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { |
| 310 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { | 310 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { |
| 311 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; | 311 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; |
| 312 return false; | 312 return false; |
| 313 } | 313 } |
| 314 return RegisterNativesImpl(env); | 314 return RegisterNativesImpl(env); |
| 315 } | 315 } |
| 316 | 316 |
| 317 } // namespace components | 317 } // namespace components |
| OLD | NEW |