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

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: Small changes from reviews Created 5 years, 1 month 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, 41 int panel_icon_resource_id,
40 int arrow_up_resource_id, 42 int arrow_up_resource_id,
41 int close_icon_resource_id, 43 int close_icon_resource_id,
42 int progress_bar_background_resource_id, 44 int progress_bar_background_resource_id,
43 int progress_bar_resource_id, 45 int progress_bar_resource_id,
44 int search_promo_resource_id, 46 int search_promo_resource_id,
45 int peek_promo_ripple_resource_id, 47 int peek_promo_ripple_resource_id,
46 int peek_promo_text_resource_id, 48 int peek_promo_text_resource_id,
49 int search_provider_icon_sprite_bitmap_resource_id,
50 int search_provider_icon_sprite_metadata_resource_id,
47 content::ContentViewCore* content_view_core, 51 content::ContentViewCore* content_view_core,
48 bool search_promo_visible, 52 bool search_promo_visible,
49 float search_promo_height, 53 float search_promo_height,
50 float search_promo_opacity, 54 float search_promo_opacity,
51 bool search_peek_promo_visible, 55 bool search_peek_promo_visible,
52 float search_peek_promo_height, 56 float search_peek_promo_height,
53 float search_peek_promo_padding, 57 float search_peek_promo_padding,
54 float search_peek_promo_ripple_width, 58 float search_peek_promo_ripple_width,
55 float search_peek_promo_ripple_opacity, 59 float search_peek_promo_ripple_opacity,
56 float search_peek_promo_text_opacity, 60 float search_peek_promo_text_opacity,
57 float search_panel_x, 61 float search_panel_x,
58 float search_panel_y, 62 float search_panel_y,
59 float search_panel_width, 63 float search_panel_width,
60 float search_panel_height, 64 float search_panel_height,
61 float search_bar_margin_side, 65 float search_bar_margin_side,
62 float search_bar_height, 66 float search_bar_height,
63 float search_context_opacity, 67 float search_context_opacity,
64 float search_term_opacity, 68 float search_term_opacity,
65 bool search_bar_border_visible, 69 bool search_bar_border_visible,
66 float search_bar_border_height, 70 float search_bar_border_height,
67 bool search_bar_shadow_visible, 71 bool search_bar_shadow_visible,
68 float search_bar_shadow_opacity, 72 float search_bar_shadow_opacity,
73 bool search_provider_icon_sprite_visible,
74 float search_provider_icon_sprite_completion_percentage,
75 float search_provider_icon_sprite_size,
69 float arrow_icon_opacity, 76 float arrow_icon_opacity,
70 float arrow_icon_rotation, 77 float arrow_icon_rotation,
71 float close_icon_opacity, 78 float close_icon_opacity,
72 bool progress_bar_visible, 79 bool progress_bar_visible,
73 float progress_bar_height, 80 float progress_bar_height,
74 float progress_bar_opacity, 81 float progress_bar_opacity,
75 int progress_bar_completion); 82 int progress_bar_completion);
76 83
77 scoped_refptr<cc::Layer> layer() override; 84 scoped_refptr<cc::Layer> layer() override;
78 85
79 protected: 86 protected:
80 explicit ContextualSearchLayer(ui::ResourceManager* resource_manager); 87 explicit ContextualSearchLayer(ui::ResourceManager* resource_manager);
81 ~ContextualSearchLayer() override; 88 ~ContextualSearchLayer() override;
82 89
83 private: 90 private:
84 ui::ResourceManager* resource_manager_; 91 ui::ResourceManager* resource_manager_;
85 92
86 scoped_refptr<cc::Layer> layer_; 93 scoped_refptr<cc::Layer> layer_;
87 scoped_refptr<cc::NinePatchLayer> panel_shadow_; 94 scoped_refptr<cc::NinePatchLayer> panel_shadow_;
88 scoped_refptr<cc::SolidColorLayer> search_bar_background_; 95 scoped_refptr<cc::SolidColorLayer> search_bar_background_;
89 scoped_refptr<cc::UIResourceLayer> search_context_; 96 scoped_refptr<cc::UIResourceLayer> search_context_;
90 scoped_refptr<cc::UIResourceLayer> search_term_; 97 scoped_refptr<cc::UIResourceLayer> search_term_;
91 scoped_refptr<cc::UIResourceLayer> search_bar_shadow_; 98 scoped_refptr<cc::UIResourceLayer> search_bar_shadow_;
92 scoped_refptr<cc::UIResourceLayer> search_provider_icon_; 99 scoped_refptr<cc::UIResourceLayer> panel_icon_;
100 scoped_refptr<CrushedSpriteLayer> search_provider_icon_sprite_;
93 scoped_refptr<cc::UIResourceLayer> arrow_icon_; 101 scoped_refptr<cc::UIResourceLayer> arrow_icon_;
94 scoped_refptr<cc::UIResourceLayer> close_icon_; 102 scoped_refptr<cc::UIResourceLayer> close_icon_;
95 scoped_refptr<cc::Layer> content_view_container_; 103 scoped_refptr<cc::Layer> content_view_container_;
96 scoped_refptr<cc::SolidColorLayer> search_bar_border_; 104 scoped_refptr<cc::SolidColorLayer> search_bar_border_;
97 scoped_refptr<cc::NinePatchLayer> progress_bar_; 105 scoped_refptr<cc::NinePatchLayer> progress_bar_;
98 scoped_refptr<cc::NinePatchLayer> progress_bar_background_; 106 scoped_refptr<cc::NinePatchLayer> progress_bar_background_;
99 scoped_refptr<cc::UIResourceLayer> search_promo_; 107 scoped_refptr<cc::UIResourceLayer> search_promo_;
100 scoped_refptr<cc::SolidColorLayer> search_promo_container_; 108 scoped_refptr<cc::SolidColorLayer> search_promo_container_;
101 109
102 scoped_refptr<cc::SolidColorLayer> peek_promo_container_; 110 scoped_refptr<cc::SolidColorLayer> peek_promo_container_;
103 scoped_refptr<cc::NinePatchLayer> peek_promo_ripple_; 111 scoped_refptr<cc::NinePatchLayer> peek_promo_ripple_;
104 scoped_refptr<cc::UIResourceLayer> peek_promo_text_; 112 scoped_refptr<cc::UIResourceLayer> peek_promo_text_;
105 }; 113 };
106 114
107 } // namespace android 115 } // namespace android
108 } // namespace chrome 116 } // namespace chrome
109 117
110 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_ 118 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_CONTEXTUAL_SEARCH_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698