OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 content_offset.y(), | 420 content_offset.y(), |
421 overdraw_bottom_height); | 421 overdraw_bottom_height); |
422 } | 422 } |
423 | 423 |
424 void ContentViewCoreImpl::SetTitle(const base::string16& title) { | 424 void ContentViewCoreImpl::SetTitle(const base::string16& title) { |
425 JNIEnv* env = AttachCurrentThread(); | 425 JNIEnv* env = AttachCurrentThread(); |
426 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 426 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
427 if (obj.is_null()) | 427 if (obj.is_null()) |
428 return; | 428 return; |
429 ScopedJavaLocalRef<jstring> jtitle = | 429 ScopedJavaLocalRef<jstring> jtitle = |
430 ConvertUTF8ToJavaString(env, UTF16ToUTF8(title)); | 430 ConvertUTF8ToJavaString(env, base::UTF16ToUTF8(title)); |
431 Java_ContentViewCore_setTitle(env, obj.obj(), jtitle.obj()); | 431 Java_ContentViewCore_setTitle(env, obj.obj(), jtitle.obj()); |
432 } | 432 } |
433 | 433 |
434 void ContentViewCoreImpl::OnBackgroundColorChanged(SkColor color) { | 434 void ContentViewCoreImpl::OnBackgroundColorChanged(SkColor color) { |
435 JNIEnv* env = AttachCurrentThread(); | 435 JNIEnv* env = AttachCurrentThread(); |
436 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 436 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
437 if (obj.is_null()) | 437 if (obj.is_null()) |
438 return; | 438 return; |
439 Java_ContentViewCore_onBackgroundColorChanged(env, obj.obj(), color); | 439 Java_ContentViewCore_onBackgroundColorChanged(env, obj.obj(), color); |
440 } | 440 } |
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1637 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1638 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1638 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1639 return reinterpret_cast<intptr_t>(view); | 1639 return reinterpret_cast<intptr_t>(view); |
1640 } | 1640 } |
1641 | 1641 |
1642 bool RegisterContentViewCore(JNIEnv* env) { | 1642 bool RegisterContentViewCore(JNIEnv* env) { |
1643 return RegisterNativesImpl(env); | 1643 return RegisterNativesImpl(env); |
1644 } | 1644 } |
1645 | 1645 |
1646 } // namespace content | 1646 } // namespace content |
OLD | NEW |