| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/android/compositor/scene_layer/contextual_search_scene_
layer.h" | 5 #include "chrome/browser/android/compositor/scene_layer/contextual_search_scene_
layer.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "chrome/browser/android/compositor/layer/contextual_search_layer.h" | 8 #include "chrome/browser/android/compositor/layer/contextual_search_layer.h" |
| 9 #include "content/public/browser/android/content_view_core.h" | 9 #include "content/public/browser/android/content_view_core.h" |
| 10 #include "jni/ContextualSearchSceneLayer_jni.h" | 10 #include "jni/ContextualSearchSceneLayer_jni.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 void ContextualSearchSceneLayer::UpdateContextualSearchLayer( | 24 void ContextualSearchSceneLayer::UpdateContextualSearchLayer( |
| 25 JNIEnv* env, | 25 JNIEnv* env, |
| 26 jobject object, | 26 jobject object, |
| 27 jint search_bar_background_resource_id, | 27 jint search_bar_background_resource_id, |
| 28 jint search_bar_text_resource_id, | 28 jint search_bar_text_resource_id, |
| 29 jint search_bar_shadow_resource_id, | 29 jint search_bar_shadow_resource_id, |
| 30 jint search_provider_icon_resource_id, | 30 jint search_provider_icon_resource_id, |
| 31 jint search_icon_resource_id, | 31 jint search_icon_resource_id, |
| 32 jint arrow_up_resource_id, | 32 jint arrow_up_resource_id, |
| 33 jint close_icon_resource_id, |
| 33 jint progress_bar_background_resource_id, | 34 jint progress_bar_background_resource_id, |
| 34 jint progress_bar_resource_id, | 35 jint progress_bar_resource_id, |
| 35 jint search_promo_resource_id, | 36 jint search_promo_resource_id, |
| 36 jobject jcontent_view_core, | 37 jobject jcontent_view_core, |
| 37 jboolean search_promo_visible, | 38 jboolean search_promo_visible, |
| 38 jfloat search_promo_height, | 39 jfloat search_promo_height, |
| 39 jfloat search_promo_opacity, | 40 jfloat search_promo_opacity, |
| 40 jfloat search_panel_y, | 41 jfloat search_panel_y, |
| 41 jfloat search_panel_width, | 42 jfloat search_panel_width, |
| 42 jfloat search_bar_margin_top, | 43 jfloat search_bar_margin_top, |
| 43 jfloat search_bar_margin_side, | 44 jfloat search_bar_margin_side, |
| 44 jfloat search_bar_height, | 45 jfloat search_bar_height, |
| 45 jfloat search_bar_text_opacity, | 46 jfloat search_bar_text_opacity, |
| 46 jboolean search_bar_border_visible, | 47 jboolean search_bar_border_visible, |
| 47 jfloat search_bar_border_y, | 48 jfloat search_bar_border_y, |
| 48 jfloat search_bar_border_height, | 49 jfloat search_bar_border_height, |
| 49 jboolean search_bar_shadow_visible, | 50 jboolean search_bar_shadow_visible, |
| 50 jfloat search_bar_shadow_opacity, | 51 jfloat search_bar_shadow_opacity, |
| 51 jfloat search_provider_icon_opacity, | 52 jfloat search_provider_icon_opacity, |
| 52 jfloat search_icon_opacity, | 53 jfloat search_icon_opacity, |
| 53 jboolean arrow_icon_visible, | 54 jboolean arrow_icon_visible, |
| 54 jfloat arrow_icon_opacity, | 55 jfloat arrow_icon_opacity, |
| 55 jfloat arrow_icon_rotation, | 56 jfloat arrow_icon_rotation, |
| 57 jboolean close_icon_visible, |
| 58 jfloat close_icon_opacity, |
| 56 jboolean progress_bar_visible, | 59 jboolean progress_bar_visible, |
| 57 jfloat progress_bar_y, | 60 jfloat progress_bar_y, |
| 58 jfloat progress_bar_height, | 61 jfloat progress_bar_height, |
| 59 jfloat progress_bar_opacity, | 62 jfloat progress_bar_opacity, |
| 60 jint progress_bar_completion, | 63 jint progress_bar_completion, |
| 61 jobject jresource_manager) { | 64 jobject jresource_manager) { |
| 62 ui::ResourceManager* resource_manager = | 65 ui::ResourceManager* resource_manager = |
| 63 ui::ResourceManagerImpl::FromJavaObject(jresource_manager); | 66 ui::ResourceManagerImpl::FromJavaObject(jresource_manager); |
| 64 // Lazily construct the contextual search layer, as the feature is only | 67 // Lazily construct the contextual search layer, as the feature is only |
| 65 // conditionally enabled. | 68 // conditionally enabled. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 78 : content::ContentViewCore::GetNativeContentViewCore( | 81 : content::ContentViewCore::GetNativeContentViewCore( |
| 79 env, jcontent_view_core); | 82 env, jcontent_view_core); |
| 80 | 83 |
| 81 contextual_search_layer_->SetProperties( | 84 contextual_search_layer_->SetProperties( |
| 82 search_bar_background_resource_id, | 85 search_bar_background_resource_id, |
| 83 search_bar_text_resource_id, | 86 search_bar_text_resource_id, |
| 84 search_bar_shadow_resource_id, | 87 search_bar_shadow_resource_id, |
| 85 search_provider_icon_resource_id, | 88 search_provider_icon_resource_id, |
| 86 search_icon_resource_id, | 89 search_icon_resource_id, |
| 87 arrow_up_resource_id, | 90 arrow_up_resource_id, |
| 91 close_icon_resource_id, |
| 88 progress_bar_background_resource_id, | 92 progress_bar_background_resource_id, |
| 89 progress_bar_resource_id, | 93 progress_bar_resource_id, |
| 90 search_promo_resource_id, | 94 search_promo_resource_id, |
| 91 content_view_core, | 95 content_view_core, |
| 92 search_promo_visible, | 96 search_promo_visible, |
| 93 search_promo_height, | 97 search_promo_height, |
| 94 search_promo_opacity, | 98 search_promo_opacity, |
| 95 search_panel_y, | 99 search_panel_y, |
| 96 search_panel_width, | 100 search_panel_width, |
| 97 search_bar_margin_top, | 101 search_bar_margin_top, |
| 98 search_bar_margin_side, | 102 search_bar_margin_side, |
| 99 search_bar_height, | 103 search_bar_height, |
| 100 search_bar_text_opacity, | 104 search_bar_text_opacity, |
| 101 search_bar_border_visible, | 105 search_bar_border_visible, |
| 102 search_bar_border_y, | 106 search_bar_border_y, |
| 103 search_bar_border_height, | 107 search_bar_border_height, |
| 104 search_bar_shadow_visible, | 108 search_bar_shadow_visible, |
| 105 search_bar_shadow_opacity, | 109 search_bar_shadow_opacity, |
| 106 search_provider_icon_opacity, | 110 search_provider_icon_opacity, |
| 107 search_icon_opacity, | 111 search_icon_opacity, |
| 108 arrow_icon_visible, | 112 arrow_icon_visible, |
| 109 arrow_icon_opacity, | 113 arrow_icon_opacity, |
| 110 arrow_icon_rotation, | 114 arrow_icon_rotation, |
| 115 close_icon_visible, |
| 116 close_icon_opacity, |
| 111 progress_bar_visible, | 117 progress_bar_visible, |
| 112 progress_bar_y, | 118 progress_bar_y, |
| 113 progress_bar_height, | 119 progress_bar_height, |
| 114 progress_bar_opacity, | 120 progress_bar_opacity, |
| 115 progress_bar_completion); | 121 progress_bar_completion); |
| 116 } | 122 } |
| 117 | 123 |
| 118 static jlong Init(JNIEnv* env, jobject jobj) { | 124 static jlong Init(JNIEnv* env, jobject jobj) { |
| 119 // This will automatically bind to the Java object and pass ownership there. | 125 // This will automatically bind to the Java object and pass ownership there. |
| 120 ContextualSearchSceneLayer* tree_provider = | 126 ContextualSearchSceneLayer* tree_provider = |
| 121 new ContextualSearchSceneLayer(env, jobj); | 127 new ContextualSearchSceneLayer(env, jobj); |
| 122 return reinterpret_cast<intptr_t>(tree_provider); | 128 return reinterpret_cast<intptr_t>(tree_provider); |
| 123 } | 129 } |
| 124 | 130 |
| 125 bool RegisterContextualSearchSceneLayer(JNIEnv* env) { | 131 bool RegisterContextualSearchSceneLayer(JNIEnv* env) { |
| 126 return RegisterNativesImpl(env); | 132 return RegisterNativesImpl(env); |
| 127 } | 133 } |
| 128 | 134 |
| 129 } // namespace android | 135 } // namespace android |
| 130 } // namespace chrome | 136 } // namespace chrome |
| OLD | NEW |