OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_ |
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_ | 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "chrome/browser/android/compositor/layer/overlay_panel_layer.h" | 10 #include "chrome/browser/android/compositor/layer/overlay_panel_layer.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class ContextualSearchLayer : public OverlayPanelLayer { | 31 class ContextualSearchLayer : public OverlayPanelLayer { |
32 public: | 32 public: |
33 static scoped_refptr<ContextualSearchLayer> Create( | 33 static scoped_refptr<ContextualSearchLayer> Create( |
34 ui::ResourceManager* resource_manager); | 34 ui::ResourceManager* resource_manager); |
35 | 35 |
36 void SetProperties(int panel_shadow_resource_id, | 36 void SetProperties(int panel_shadow_resource_id, |
37 int search_context_resource_id, | 37 int search_context_resource_id, |
38 int search_term_resource_id, | 38 int search_term_resource_id, |
39 int search_caption_resource_id, | 39 int search_caption_resource_id, |
40 int search_bar_shadow_resource_id, | 40 int search_bar_shadow_resource_id, |
41 int panel_icon_resource_id, | 41 int sprite_resource_id, |
42 int search_provider_icon_sprite_metadata_resource_id, | 42 int search_provider_icon_sprite_metadata_resource_id, |
| 43 int static_icon_resource_id, |
43 int arrow_up_resource_id, | 44 int arrow_up_resource_id, |
44 int close_icon_resource_id, | 45 int close_icon_resource_id, |
45 int progress_bar_background_resource_id, | 46 int progress_bar_background_resource_id, |
46 int progress_bar_resource_id, | 47 int progress_bar_resource_id, |
47 int search_promo_resource_id, | 48 int search_promo_resource_id, |
48 int peek_promo_ripple_resource_id, | 49 int peek_promo_ripple_resource_id, |
49 int peek_promo_text_resource_id, | 50 int peek_promo_text_resource_id, |
50 float dp_to_px, | 51 float dp_to_px, |
51 const scoped_refptr<cc::Layer>& content_layer, | 52 const scoped_refptr<cc::Layer>& content_layer, |
52 bool search_promo_visible, | 53 bool search_promo_visible, |
(...skipping 16 matching lines...) Expand all Loading... |
69 float search_term_opacity, | 70 float search_term_opacity, |
70 float search_term_caption_spacing, | 71 float search_term_caption_spacing, |
71 float search_caption_animation_percentage, | 72 float search_caption_animation_percentage, |
72 bool search_caption_visible, | 73 bool search_caption_visible, |
73 bool search_bar_border_visible, | 74 bool search_bar_border_visible, |
74 float search_bar_border_height, | 75 float search_bar_border_height, |
75 bool search_bar_shadow_visible, | 76 bool search_bar_shadow_visible, |
76 float search_bar_shadow_opacity, | 77 float search_bar_shadow_opacity, |
77 bool search_provider_icon_sprite_visible, | 78 bool search_provider_icon_sprite_visible, |
78 float search_provider_icon_sprite_completion_percentage, | 79 float search_provider_icon_sprite_completion_percentage, |
| 80 bool static_icon_visible, |
79 bool thumbnail_visible, | 81 bool thumbnail_visible, |
80 float thumbnail_visibility_percentage, | 82 float static_image_visibility_percentage, |
81 int thumbnail_size, | 83 int static_image_size, |
82 float arrow_icon_opacity, | 84 float arrow_icon_opacity, |
83 float arrow_icon_rotation, | 85 float arrow_icon_rotation, |
84 float close_icon_opacity, | 86 float close_icon_opacity, |
85 bool progress_bar_visible, | 87 bool progress_bar_visible, |
86 float progress_bar_height, | 88 float progress_bar_height, |
87 float progress_bar_opacity, | 89 float progress_bar_opacity, |
88 int progress_bar_completion); | 90 int progress_bar_completion); |
89 | 91 |
90 void SetThumbnail(const SkBitmap* thumbnail); | 92 void SetThumbnail(const SkBitmap* thumbnail); |
91 | 93 |
92 protected: | 94 protected: |
93 explicit ContextualSearchLayer(ui::ResourceManager* resource_manager); | 95 explicit ContextualSearchLayer(ui::ResourceManager* resource_manager); |
94 ~ContextualSearchLayer() override; | 96 ~ContextualSearchLayer() override; |
95 scoped_refptr<cc::Layer> GetIconLayer() override; | 97 scoped_refptr<cc::Layer> GetIconLayer() override; |
96 | 98 |
97 private: | 99 private: |
98 // Sets up |icon_layer_|, which displays an icon or thumbnail at the start | 100 // Sets up |icon_layer_|, which displays an icon or thumbnail at the start |
99 // of the Bar. | 101 // of the Bar. |
100 void SetupIconLayer(bool search_provider_icon_sprite_visible, | 102 void SetupIconLayer(bool search_provider_icon_sprite_visible, |
101 int search_provider_icon_sprite_metadata_resource_id, | 103 int search_provider_icon_sprite_metadata_resource_id, |
102 float search_provider_icon_sprite_completion_percentage, | 104 float search_provider_icon_sprite_completion_percentage, |
| 105 bool static_icon_visible, |
| 106 int static_icon_resource_id, |
103 bool thumbnail_visible, | 107 bool thumbnail_visible, |
104 float thumbnail_visibility_percentage); | 108 float static_image_visibility_percentage); |
| 109 |
| 110 void SetStaticImageProperties( |
| 111 scoped_refptr<cc::UIResourceLayer> static_image_layer, |
| 112 float top_margin, |
| 113 float side_margin, |
| 114 float visibility_percentage); |
105 | 115 |
106 // Sets up |text_layer_|, which contains |bar_text_|, |search_context_| and | 116 // Sets up |text_layer_|, which contains |bar_text_|, |search_context_| and |
107 // |search_caption_|. | 117 // |search_caption_|. |
108 void SetupTextLayer( | 118 void SetupTextLayer( |
109 float search_bar_top, | 119 float search_bar_top, |
110 float search_bar_height, | 120 float search_bar_height, |
111 float search_text_layer_min_height, | 121 float search_text_layer_min_height, |
112 int search_caption_resource_id, | 122 int search_caption_resource_id, |
113 bool search_caption_visible, | 123 bool search_caption_visible, |
114 float search_caption_animation_percentage, | 124 float search_caption_animation_percentage, |
115 int search_context_resource_id, | 125 int search_context_resource_id, |
116 float search_context_opacity, | 126 float search_context_opacity, |
117 float search_term_caption_spacing); | 127 float search_term_caption_spacing); |
118 | 128 |
119 int thumbnail_size_; | 129 int static_image_size_; |
120 float thumbnail_side_margin_; | 130 float thumbnail_side_margin_; |
121 float thumbnail_top_margin_; | 131 float thumbnail_top_margin_; |
122 | 132 |
123 scoped_refptr<cc::UIResourceLayer> search_context_; | 133 scoped_refptr<cc::UIResourceLayer> search_context_; |
124 scoped_refptr<cc::Layer> icon_layer_; | 134 scoped_refptr<cc::Layer> icon_layer_; |
125 scoped_refptr<CrushedSpriteLayer> search_provider_icon_sprite_; | 135 scoped_refptr<CrushedSpriteLayer> search_provider_icon_sprite_; |
126 scoped_refptr<cc::UIResourceLayer> thumbnail_layer_; | 136 scoped_refptr<cc::UIResourceLayer> thumbnail_layer_; |
| 137 scoped_refptr<cc::UIResourceLayer> static_icon_layer_; |
127 scoped_refptr<cc::UIResourceLayer> arrow_icon_; | 138 scoped_refptr<cc::UIResourceLayer> arrow_icon_; |
128 scoped_refptr<cc::UIResourceLayer> search_promo_; | 139 scoped_refptr<cc::UIResourceLayer> search_promo_; |
129 scoped_refptr<cc::SolidColorLayer> search_promo_container_; | 140 scoped_refptr<cc::SolidColorLayer> search_promo_container_; |
130 scoped_refptr<cc::SolidColorLayer> peek_promo_container_; | 141 scoped_refptr<cc::SolidColorLayer> peek_promo_container_; |
131 scoped_refptr<cc::NinePatchLayer> peek_promo_ripple_; | 142 scoped_refptr<cc::NinePatchLayer> peek_promo_ripple_; |
132 scoped_refptr<cc::UIResourceLayer> peek_promo_text_; | 143 scoped_refptr<cc::UIResourceLayer> peek_promo_text_; |
133 scoped_refptr<cc::NinePatchLayer> progress_bar_; | 144 scoped_refptr<cc::NinePatchLayer> progress_bar_; |
134 scoped_refptr<cc::NinePatchLayer> progress_bar_background_; | 145 scoped_refptr<cc::NinePatchLayer> progress_bar_background_; |
135 scoped_refptr<cc::UIResourceLayer> search_caption_; | 146 scoped_refptr<cc::UIResourceLayer> search_caption_; |
136 scoped_refptr<cc::UIResourceLayer> text_layer_; | 147 scoped_refptr<cc::UIResourceLayer> text_layer_; |
137 }; | 148 }; |
138 | 149 |
139 } // namespace android | 150 } // namespace android |
140 | 151 |
141 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_ | 152 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_ |
OLD | NEW |