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
,
89 float toolbar_y_offset
,
90 float side_border_scale
,
94 bool is_incognito() const { return incognito_
; }
96 scoped_refptr
<cc::Layer
> layer() override
;
99 TabLayer(bool incognito
,
100 ui::ResourceManager
* resource_manager
,
101 LayerTitleCache
* layer_title_cache
,
102 TabContentManager
* tab_content_manager
);
103 ~TabLayer() override
;
106 void SetTitle(DecorationTitle
* title
);
108 const bool incognito_
;
109 ui::ResourceManager
* resource_manager_
;
110 LayerTitleCache
* layer_title_cache_
;
112 // [layer]-+-[toolbar]
119 // +-[contour_shadow]
123 scoped_refptr
<cc::Layer
> layer_
;
124 scoped_refptr
<ToolbarLayer
> toolbar_layer_
;
125 scoped_refptr
<cc::Layer
> title_
;
126 scoped_refptr
<ContentLayer
> content_
;
127 scoped_refptr
<cc::SolidColorLayer
> padding_
;
128 scoped_refptr
<cc::UIResourceLayer
> close_button_
;
129 scoped_refptr
<cc::NinePatchLayer
> front_border_
;
130 scoped_refptr
<cc::NinePatchLayer
> contour_shadow_
;
131 scoped_refptr
<cc::NinePatchLayer
> shadow_
;
132 scoped_refptr
<cc::UIResourceLayer
> back_logo_
;
135 DISALLOW_COPY_AND_ASSIGN(TabLayer
);
138 } // namespace android
139 } // namespace chrome
141 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TAB_LAYER_H_