Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: chrome/browser/android/compositor/scene_layer/contextual_search_scene_layer.cc

Issue 1219133003: Contextual Search UI changes for custom tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use fadingInPercentage and fadingOutPercentage, get rid of PanelBase#isCloseIconVisible() Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 jboolean side_search_provider_icon_visible, 52 jboolean side_search_provider_icon_visible,
52 jfloat search_provider_icon_opacity, 53 jfloat search_provider_icon_opacity,
53 jboolean search_icon_visible, 54 jboolean search_icon_visible,
54 jfloat search_icon_opacity, 55 jfloat search_icon_opacity,
55 jboolean arrow_icon_visible, 56 jboolean arrow_icon_visible,
56 jfloat arrow_icon_opacity, 57 jfloat arrow_icon_opacity,
57 jfloat arrow_icon_rotation, 58 jfloat arrow_icon_rotation,
59 jboolean close_icon_visible,
60 jfloat close_icon_opacity,
58 jboolean progress_bar_visible, 61 jboolean progress_bar_visible,
59 jfloat progress_bar_y, 62 jfloat progress_bar_y,
60 jfloat progress_bar_height, 63 jfloat progress_bar_height,
61 jfloat progress_bar_opacity, 64 jfloat progress_bar_opacity,
62 jint progress_bar_completion, 65 jint progress_bar_completion,
63 jobject jresource_manager) { 66 jobject jresource_manager) {
64 ui::ResourceManager* resource_manager = 67 ui::ResourceManager* resource_manager =
65 ui::ResourceManagerImpl::FromJavaObject(jresource_manager); 68 ui::ResourceManagerImpl::FromJavaObject(jresource_manager);
66 // Lazily construct the contextual search layer, as the feature is only 69 // Lazily construct the contextual search layer, as the feature is only
67 // conditionally enabled. 70 // conditionally enabled.
(...skipping 12 matching lines...) Expand all
80 : content::ContentViewCore::GetNativeContentViewCore( 83 : content::ContentViewCore::GetNativeContentViewCore(
81 env, jcontent_view_core); 84 env, jcontent_view_core);
82 85
83 contextual_search_layer_->SetProperties( 86 contextual_search_layer_->SetProperties(
84 search_bar_background_resource_id, 87 search_bar_background_resource_id,
85 search_bar_text_resource_id, 88 search_bar_text_resource_id,
86 search_bar_shadow_resource_id, 89 search_bar_shadow_resource_id,
87 search_provider_icon_resource_id, 90 search_provider_icon_resource_id,
88 search_icon_resource_id, 91 search_icon_resource_id,
89 arrow_up_resource_id, 92 arrow_up_resource_id,
93 close_icon_resource_id,
90 progress_bar_background_resource_id, 94 progress_bar_background_resource_id,
91 progress_bar_resource_id, 95 progress_bar_resource_id,
92 search_promo_resource_id, 96 search_promo_resource_id,
93 content_view_core, 97 content_view_core,
94 search_promo_visible, 98 search_promo_visible,
95 search_promo_height, 99 search_promo_height,
96 search_promo_opacity, 100 search_promo_opacity,
97 search_panel_y, 101 search_panel_y,
98 search_panel_width, 102 search_panel_width,
99 search_bar_margin_top, 103 search_bar_margin_top,
100 search_bar_margin_side, 104 search_bar_margin_side,
101 search_bar_height, 105 search_bar_height,
102 search_bar_text_opacity, 106 search_bar_text_opacity,
103 search_bar_border_visible, 107 search_bar_border_visible,
104 search_bar_border_y, 108 search_bar_border_y,
105 search_bar_border_height, 109 search_bar_border_height,
106 search_bar_shadow_visible, 110 search_bar_shadow_visible,
107 search_bar_shadow_opacity, 111 search_bar_shadow_opacity,
108 side_search_provider_icon_visible, 112 side_search_provider_icon_visible,
109 search_provider_icon_opacity, 113 search_provider_icon_opacity,
110 search_icon_visible, 114 search_icon_visible,
111 search_icon_opacity, 115 search_icon_opacity,
112 arrow_icon_visible, 116 arrow_icon_visible,
113 arrow_icon_opacity, 117 arrow_icon_opacity,
114 arrow_icon_rotation, 118 arrow_icon_rotation,
119 close_icon_visible,
120 close_icon_opacity,
115 progress_bar_visible, 121 progress_bar_visible,
116 progress_bar_y, 122 progress_bar_y,
117 progress_bar_height, 123 progress_bar_height,
118 progress_bar_opacity, 124 progress_bar_opacity,
119 progress_bar_completion); 125 progress_bar_completion);
120 } 126 }
121 127
122 static jlong Init(JNIEnv* env, jobject jobj) { 128 static jlong Init(JNIEnv* env, jobject jobj) {
123 // This will automatically bind to the Java object and pass ownership there. 129 // This will automatically bind to the Java object and pass ownership there.
124 ContextualSearchSceneLayer* tree_provider = 130 ContextualSearchSceneLayer* tree_provider =
125 new ContextualSearchSceneLayer(env, jobj); 131 new ContextualSearchSceneLayer(env, jobj);
126 return reinterpret_cast<intptr_t>(tree_provider); 132 return reinterpret_cast<intptr_t>(tree_provider);
127 } 133 }
128 134
129 bool RegisterContextualSearchSceneLayer(JNIEnv* env) { 135 bool RegisterContextualSearchSceneLayer(JNIEnv* env) {
130 return RegisterNativesImpl(env); 136 return RegisterNativesImpl(env);
131 } 137 }
132 138
133 } // namespace android 139 } // namespace android
134 } // namespace chrome 140 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698