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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 return java_ref_.get(env); | 318 return java_ref_.get(env); |
319 } | 319 } |
320 | 320 |
321 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { | 321 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { |
322 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); | 322 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); |
323 if (!rwhva) | 323 if (!rwhva) |
324 return SK_ColorWHITE; | 324 return SK_ColorWHITE; |
325 return rwhva->GetCachedBackgroundColor(); | 325 return rwhva->GetCachedBackgroundColor(); |
326 } | 326 } |
327 | 327 |
328 void ContentViewCoreImpl::SetBackgroundColor(JNIEnv* env, | |
329 jobject obj, | |
330 jint color) { | |
331 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); | |
332 if (!rwhva) | |
333 return; | |
334 rwhva->OnDidChangeBodyBackgroundColor(color); | |
335 } | |
336 | |
337 void ContentViewCoreImpl::OnHide(JNIEnv* env, jobject obj) { | 328 void ContentViewCoreImpl::OnHide(JNIEnv* env, jobject obj) { |
338 Hide(); | 329 Hide(); |
339 } | 330 } |
340 | 331 |
341 void ContentViewCoreImpl::OnShow(JNIEnv* env, jobject obj) { | 332 void ContentViewCoreImpl::OnShow(JNIEnv* env, jobject obj) { |
342 Show(); | 333 Show(); |
343 } | 334 } |
344 | 335 |
345 void ContentViewCoreImpl::Show() { | 336 void ContentViewCoreImpl::Show() { |
346 GetWebContents()->WasShown(); | 337 GetWebContents()->WasShown(); |
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1613 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1623 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1614 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1624 return reinterpret_cast<jint>(view); | 1615 return reinterpret_cast<jint>(view); |
1625 } | 1616 } |
1626 | 1617 |
1627 bool RegisterContentViewCore(JNIEnv* env) { | 1618 bool RegisterContentViewCore(JNIEnv* env) { |
1628 return RegisterNativesImpl(env); | 1619 return RegisterNativesImpl(env); |
1629 } | 1620 } |
1630 | 1621 |
1631 } // namespace content | 1622 } // namespace content |
OLD | NEW |