| 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 "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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 jfloat progress_bar_opacity, | 115 jfloat progress_bar_opacity, |
| 116 jint progress_bar_completion, | 116 jint progress_bar_completion, |
| 117 jfloat divider_line_visibility_percentage, | 117 jfloat divider_line_visibility_percentage, |
| 118 jfloat divider_line_width, | 118 jfloat divider_line_width, |
| 119 jfloat divider_line_height, | 119 jfloat divider_line_height, |
| 120 jint divider_line_color, | 120 jint divider_line_color, |
| 121 jfloat divider_line_x_offset, | 121 jfloat divider_line_x_offset, |
| 122 jboolean touch_highlight_visible, | 122 jboolean touch_highlight_visible, |
| 123 jfloat touch_highlight_x_offset, | 123 jfloat touch_highlight_x_offset, |
| 124 jfloat touch_highlight_width, | 124 jfloat touch_highlight_width, |
| 125 jint bar_handle_resource_id, |
| 126 jfloat bar_handle_offset_y, |
| 127 jfloat bar_padding_bottom, |
| 125 jobject j_profile) { | 128 jobject j_profile) { |
| 126 // Load the thumbnail if necessary. | 129 // Load the thumbnail if necessary. |
| 127 std::string thumbnail_url = | 130 std::string thumbnail_url = |
| 128 base::android::ConvertJavaStringToUTF8(env, j_thumbnail_url); | 131 base::android::ConvertJavaStringToUTF8(env, j_thumbnail_url); |
| 129 if (thumbnail_url != thumbnail_url_) { | 132 if (thumbnail_url != thumbnail_url_) { |
| 130 thumbnail_url_ = thumbnail_url; | 133 thumbnail_url_ = thumbnail_url; |
| 131 FetchThumbnail(j_profile); | 134 FetchThumbnail(j_profile); |
| 132 } | 135 } |
| 133 | 136 |
| 134 // NOTE(pedrosimonetti): The WebContents might not exist at this time if | 137 // NOTE(pedrosimonetti): The WebContents might not exist at this time if |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 search_text_layer_min_height, search_term_opacity, | 174 search_text_layer_min_height, search_term_opacity, |
| 172 search_term_caption_spacing, search_caption_animation_percentage, | 175 search_term_caption_spacing, search_caption_animation_percentage, |
| 173 search_caption_visible, search_bar_border_visible, | 176 search_caption_visible, search_bar_border_visible, |
| 174 search_bar_border_height, search_bar_shadow_visible, | 177 search_bar_border_height, search_bar_shadow_visible, |
| 175 search_bar_shadow_opacity, quick_action_icon_visible, thumbnail_visible, | 178 search_bar_shadow_opacity, quick_action_icon_visible, thumbnail_visible, |
| 176 custom_image_visibility_percentage, bar_image_size, arrow_icon_opacity, | 179 custom_image_visibility_percentage, bar_image_size, arrow_icon_opacity, |
| 177 arrow_icon_rotation, close_icon_opacity, progress_bar_visible, | 180 arrow_icon_rotation, close_icon_opacity, progress_bar_visible, |
| 178 progress_bar_height, progress_bar_opacity, progress_bar_completion, | 181 progress_bar_height, progress_bar_opacity, progress_bar_completion, |
| 179 divider_line_visibility_percentage, divider_line_width, | 182 divider_line_visibility_percentage, divider_line_width, |
| 180 divider_line_height, divider_line_color, divider_line_x_offset, | 183 divider_line_height, divider_line_color, divider_line_x_offset, |
| 181 touch_highlight_visible, touch_highlight_x_offset, touch_highlight_width); | 184 touch_highlight_visible, touch_highlight_x_offset, touch_highlight_width, |
| 185 bar_handle_resource_id, bar_handle_offset_y, bar_padding_bottom); |
| 182 | 186 |
| 183 // Make the layer visible if it is not already. | 187 // Make the layer visible if it is not already. |
| 184 contextual_search_layer_->layer()->SetHideLayerAndSubtree(false); | 188 contextual_search_layer_->layer()->SetHideLayerAndSubtree(false); |
| 185 } | 189 } |
| 186 | 190 |
| 187 void ContextualSearchSceneLayer::FetchThumbnail(jobject j_profile) { | 191 void ContextualSearchSceneLayer::FetchThumbnail(jobject j_profile) { |
| 188 if (thumbnail_url_.empty()) | 192 if (thumbnail_url_.empty()) |
| 189 return; | 193 return; |
| 190 | 194 |
| 191 GURL gurl(thumbnail_url_); | 195 GURL gurl(thumbnail_url_); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 ContextualSearchSceneLayer* tree_provider = | 248 ContextualSearchSceneLayer* tree_provider = |
| 245 new ContextualSearchSceneLayer(env, jobj); | 249 new ContextualSearchSceneLayer(env, jobj); |
| 246 return reinterpret_cast<intptr_t>(tree_provider); | 250 return reinterpret_cast<intptr_t>(tree_provider); |
| 247 } | 251 } |
| 248 | 252 |
| 249 bool RegisterContextualSearchSceneLayer(JNIEnv* env) { | 253 bool RegisterContextualSearchSceneLayer(JNIEnv* env) { |
| 250 return RegisterNativesImpl(env); | 254 return RegisterNativesImpl(env); |
| 251 } | 255 } |
| 252 | 256 |
| 253 } // namespace android | 257 } // namespace android |
| OLD | NEW |