Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / android / compositor / layer / tab_layer.h
blob4580ee91c138a1732dee4c55edfa5e56d0886a04
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TAB_LAYER_H_
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TAB_LAYER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/android/compositor/layer/layer.h"
12 namespace cc {
13 class ImageLayer;
14 class Layer;
15 class NinePatchLayer;
16 class SolidColorLayer;
17 class UIResourceLayer;
20 namespace gfx {
21 class Size;
24 namespace ui {
25 class ResourceManager;
28 class SkBitmap;
30 namespace chrome {
31 namespace android {
33 class ContentLayer;
34 class DecorationTitle;
35 class LayerTitleCache;
36 class TabContentManager;
37 class ToolbarLayer;
39 // Sub layer tree representation of a tab. A TabLayer is not tied to
40 // specific tab. To specialize it call CustomizeForId() and SetProperties().
41 class TabLayer : public Layer {
42 public:
43 static scoped_refptr<TabLayer> Create(bool incognito,
44 ui::ResourceManager* resource_manager,
45 LayerTitleCache* layer_title_cache,
46 TabContentManager* tab_content_manager);
48 void SetProperties(int id,
49 bool can_use_live_layer,
50 bool can_use_ntp_fallback,
51 int toolbar_resource_id,
52 int close_button_resource_id,
53 int shadow_resource_id,
54 int contour_resource_id,
55 int back_logo_resource_id,
56 int border_resource_id,
57 int default_background_color,
58 int back_logo_color,
59 bool is_portrait,
60 float x,
61 float y,
62 float width,
63 float height,
64 float shadow_x,
65 float shadow_y,
66 float shadow_width,
67 float shadow_height,
68 float pivot_x,
69 float pivot_y,
70 float rotation_x,
71 float rotation_y,
72 float alpha,
73 float border_alpha,
74 float contour_alpha,
75 float shadow_alpha,
76 float close_alpha,
77 float border_scale,
78 float saturation,
79 float brightness,
80 float close_btn_width,
81 float static_to_view_blend,
82 float content_width,
83 float content_height,
84 float view_width,
85 float view_height,
86 bool show_toolbar,
87 bool anonymize_toolbar,
88 int toolbar_textbox_background_color,
89 float toolbar_alpha,
90 float toolbar_y_offset,
91 float side_border_scale,
92 bool attach_content,
93 bool inset_border);
95 bool is_incognito() const { return incognito_; }
97 scoped_refptr<cc::Layer> layer() override;
99 protected:
100 TabLayer(bool incognito,
101 ui::ResourceManager* resource_manager,
102 LayerTitleCache* layer_title_cache,
103 TabContentManager* tab_content_manager);
104 ~TabLayer() override;
106 private:
107 void SetTitle(DecorationTitle* title);
109 const bool incognito_;
110 ui::ResourceManager* resource_manager_;
111 LayerTitleCache* layer_title_cache_;
113 // [layer]-+-[toolbar]
114 // +-[close button]
115 // +-[title]
116 // +-[front border]
117 // +-[content]
118 // +-[back_logo]
119 // +-[padding]
120 // +-[contour_shadow]
121 // +-[shadow]
123 // [back logo]
124 scoped_refptr<cc::Layer> layer_;
125 scoped_refptr<ToolbarLayer> toolbar_layer_;
126 scoped_refptr<cc::Layer> title_;
127 scoped_refptr<ContentLayer> content_;
128 scoped_refptr<cc::SolidColorLayer> padding_;
129 scoped_refptr<cc::UIResourceLayer> close_button_;
130 scoped_refptr<cc::NinePatchLayer> front_border_;
131 scoped_refptr<cc::NinePatchLayer> contour_shadow_;
132 scoped_refptr<cc::NinePatchLayer> shadow_;
133 scoped_refptr<cc::UIResourceLayer> back_logo_;
134 float brightness_;
136 DISALLOW_COPY_AND_ASSIGN(TabLayer);
139 } // namespace android
140 } // namespace chrome
142 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TAB_LAYER_H_