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

Side by Side Diff: chrome/browser/android/compositor/layer/contextual_search_layer.h

Issue 1337703002: [Contextual Search] Add support for crushed sprites and animate the search provider icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO's for other planned tests Created 5 years, 2 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 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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/android/compositor/layer/layer.h" 10 #include "chrome/browser/android/compositor/layer/layer.h"
11 11
12 namespace cc { 12 namespace cc {
13 class Layer; 13 class Layer;
14 class NinePatchLayer; 14 class NinePatchLayer;
15 class SolidColorLayer; 15 class SolidColorLayer;
16 class UIResourceLayer; 16 class UIResourceLayer;
17 } 17 }
18 18
19 namespace content { 19 namespace content {
20 class ContentViewCore; 20 class ContentViewCore;
21 } 21 }
22 22
23 namespace ui { 23 namespace ui {
24 class ResourceManager; 24 class ResourceManager;
25 } 25 }
26 26
27 namespace chrome { 27 namespace chrome {
28 namespace android { 28 namespace android {
29 29
30 class CrushedSpriteLayer;
31
30 class ContextualSearchLayer : public Layer { 32 class ContextualSearchLayer : public Layer {
31 public: 33 public:
32 static scoped_refptr<ContextualSearchLayer> Create( 34 static scoped_refptr<ContextualSearchLayer> Create(
33 ui::ResourceManager* resource_manager); 35 ui::ResourceManager* resource_manager);
34 36
35 void SetProperties(int panel_shadow_resource_id, 37 void SetProperties(int panel_shadow_resource_id,
36 int search_context_resource_id, 38 int search_context_resource_id,
37 int search_term_resource_id, 39 int search_term_resource_id,
38 int search_bar_shadow_resource_id, 40 int search_bar_shadow_resource_id,
39 int search_provider_icon_resource_id,
40 int arrow_up_resource_id, 41 int arrow_up_resource_id,
41 int close_icon_resource_id, 42 int close_icon_resource_id,
42 int progress_bar_background_resource_id, 43 int progress_bar_background_resource_id,
43 int progress_bar_resource_id, 44 int progress_bar_resource_id,
44 int search_promo_resource_id, 45 int search_promo_resource_id,
45 int peek_promo_ripple_resource_id, 46 int peek_promo_ripple_resource_id,
46 int peek_promo_text_resource_id, 47 int peek_promo_text_resource_id,
48 int search_provider_icon_sprite_bitmap_resource_id,
49 int search_provider_icon_sprite_metadata_resource_id,
47 content::ContentViewCore* content_view_core, 50 content::ContentViewCore* content_view_core,
48 bool search_promo_visible, 51 bool search_promo_visible,
49 float search_promo_height, 52 float search_promo_height,
50 float search_promo_opacity, 53 float search_promo_opacity,
51 bool search_peek_promo_visible, 54 bool search_peek_promo_visible,
52 float search_peek_promo_height, 55 float search_peek_promo_height,
53 float search_peek_promo_padding, 56 float search_peek_promo_padding,
54 float search_peek_promo_ripple_width, 57 float search_peek_promo_ripple_width,
55 float search_peek_promo_ripple_opacity, 58 float search_peek_promo_ripple_opacity,
56 float search_peek_promo_text_opacity, 59 float search_peek_promo_text_opacity,
57 float search_panel_x, 60 float search_panel_x,
58 float search_panel_y, 61 float search_panel_y,
59 float search_panel_width, 62 float search_panel_width,
60 float search_panel_height, 63 float search_panel_height,
61 float search_bar_margin_side, 64 float search_bar_margin_side,
62 float search_bar_height, 65 float search_bar_height,
63 float search_context_opacity, 66 float search_context_opacity,
64 float search_term_opacity, 67 float search_term_opacity,
65 bool search_bar_border_visible, 68 bool search_bar_border_visible,
66 float search_bar_border_height, 69 float search_bar_border_height,
67 bool search_bar_shadow_visible, 70 bool search_bar_shadow_visible,
68 float search_bar_shadow_opacity, 71 float search_bar_shadow_opacity,
72 bool search_provider_icon_sprite_visible,
73 int search_provider_icon_sprite_frame,
74 float search_provider_icon_sprite_size,
69 float arrow_icon_opacity, 75 float arrow_icon_opacity,
70 float arrow_icon_rotation, 76 float arrow_icon_rotation,
71 float close_icon_opacity, 77 float close_icon_opacity,
72 bool progress_bar_visible, 78 bool progress_bar_visible,
73 float progress_bar_height, 79 float progress_bar_height,
74 float progress_bar_opacity, 80 float progress_bar_opacity,
75 int progress_bar_completion); 81 int progress_bar_completion);
76 82
77 scoped_refptr<cc::Layer> layer() override; 83 scoped_refptr<cc::Layer> layer() override;
78 84
79 protected: 85 protected:
80 explicit ContextualSearchLayer(ui::ResourceManager* resource_manager); 86 explicit ContextualSearchLayer(ui::ResourceManager* resource_manager);
81 ~ContextualSearchLayer() override; 87 ~ContextualSearchLayer() override;
82 88
83 private: 89 private:
84 ui::ResourceManager* resource_manager_; 90 ui::ResourceManager* resource_manager_;
85 91
86 scoped_refptr<cc::Layer> layer_; 92 scoped_refptr<cc::Layer> layer_;
87 scoped_refptr<cc::NinePatchLayer> panel_shadow_; 93 scoped_refptr<cc::NinePatchLayer> panel_shadow_;
88 scoped_refptr<cc::SolidColorLayer> search_bar_background_; 94 scoped_refptr<cc::SolidColorLayer> search_bar_background_;
89 scoped_refptr<cc::UIResourceLayer> search_context_; 95 scoped_refptr<cc::UIResourceLayer> search_context_;
90 scoped_refptr<cc::UIResourceLayer> search_term_; 96 scoped_refptr<cc::UIResourceLayer> search_term_;
91 scoped_refptr<cc::UIResourceLayer> search_bar_shadow_; 97 scoped_refptr<cc::UIResourceLayer> search_bar_shadow_;
92 scoped_refptr<cc::UIResourceLayer> search_provider_icon_; 98 scoped_refptr<CrushedSpriteLayer> search_provider_icon_sprite_;
93 scoped_refptr<cc::UIResourceLayer> arrow_icon_; 99 scoped_refptr<cc::UIResourceLayer> arrow_icon_;
94 scoped_refptr<cc::UIResourceLayer> close_icon_; 100 scoped_refptr<cc::UIResourceLayer> close_icon_;
95 scoped_refptr<cc::Layer> content_view_container_; 101 scoped_refptr<cc::Layer> content_view_container_;
96 scoped_refptr<cc::SolidColorLayer> search_bar_border_; 102 scoped_refptr<cc::SolidColorLayer> search_bar_border_;
97 scoped_refptr<cc::NinePatchLayer> progress_bar_; 103 scoped_refptr<cc::NinePatchLayer> progress_bar_;
98 scoped_refptr<cc::NinePatchLayer> progress_bar_background_; 104 scoped_refptr<cc::NinePatchLayer> progress_bar_background_;
99 scoped_refptr<cc::UIResourceLayer> search_promo_; 105 scoped_refptr<cc::UIResourceLayer> search_promo_;
100 scoped_refptr<cc::SolidColorLayer> search_promo_container_; 106 scoped_refptr<cc::SolidColorLayer> search_promo_container_;
101 107
102 scoped_refptr<cc::SolidColorLayer> peek_promo_container_; 108 scoped_refptr<cc::SolidColorLayer> peek_promo_container_;
103 scoped_refptr<cc::NinePatchLayer> peek_promo_ripple_; 109 scoped_refptr<cc::NinePatchLayer> peek_promo_ripple_;
104 scoped_refptr<cc::UIResourceLayer> peek_promo_text_; 110 scoped_refptr<cc::UIResourceLayer> peek_promo_text_;
105 }; 111 };
106 112
107 } // namespace android 113 } // namespace android
108 } // namespace chrome 114 } // namespace chrome
109 115
110 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_ 116 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698