OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/android/compositor/resources/resource_factory.h" |
| 6 |
| 7 #include "chrome/browser/android/compositor/resources/toolbar_resource.h" |
| 8 #include "jni/ResourceFactory_jni.h" |
| 9 |
| 10 using base::android::JavaParamRef; |
| 11 |
| 12 namespace android { |
| 13 |
| 14 bool RegisterResourceFactory(JNIEnv* env) { |
| 15 return RegisterNativesImpl(env); |
| 16 } |
| 17 |
| 18 jlong CreateToolbarContainerResource(JNIEnv* env, |
| 19 const JavaParamRef<jclass>& clazz, |
| 20 jint toolbar_left, |
| 21 jint toolbar_top, |
| 22 jint toolbar_right, |
| 23 jint toolbar_bottom, |
| 24 jint location_bar_left, |
| 25 jint location_bar_top, |
| 26 jint location_bar_right, |
| 27 jint location_bar_bottom, |
| 28 jint shadow_height) { |
| 29 gfx::Rect toolbar_rect(toolbar_left, toolbar_top, |
| 30 toolbar_right - toolbar_left, |
| 31 toolbar_bottom - toolbar_top); |
| 32 gfx::Rect location_bar_content_rect(location_bar_left, location_bar_top, |
| 33 location_bar_right - location_bar_left, |
| 34 location_bar_bottom - location_bar_top); |
| 35 return reinterpret_cast<intptr_t>(new ToolbarResource( |
| 36 toolbar_rect, location_bar_content_rect, shadow_height)); |
| 37 } |
| 38 |
| 39 } // namespace android |
OLD | NEW |