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"
16 class SolidColorLayer
;
17 class UIResourceLayer
;
25 class ResourceManager
;
34 class DecorationTitle
;
35 class LayerTitleCache
;
36 class TabContentManager
;
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
{
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
,
80 float close_btn_width
,
81 float static_to_view_blend
,
87 bool anonymize_toolbar
,
88 int toolbar_textbox_background_color
,
90 float toolbar_y_offset
,
91 float side_border_scale
,
95 bool is_incognito() const { return incognito_
; }
97 scoped_refptr
<cc::Layer
> layer() override
;
100 TabLayer(bool incognito
,
101 ui::ResourceManager
* resource_manager
,
102 LayerTitleCache
* layer_title_cache
,
103 TabContentManager
* tab_content_manager
);
104 ~TabLayer() override
;
107 void SetTitle(DecorationTitle
* title
);
109 const bool incognito_
;
110 ui::ResourceManager
* resource_manager_
;
111 LayerTitleCache
* layer_title_cache_
;
113 // [layer]-+-[toolbar]
120 // +-[contour_shadow]
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_
;
136 DISALLOW_COPY_AND_ASSIGN(TabLayer
);
139 } // namespace android
140 } // namespace chrome
142 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TAB_LAYER_H_