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

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

Issue 787023002: Upstream more layers, decoration title, layer_title_cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated creation year Created 5 years, 12 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
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TAB_LAYER_H_
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TAB_LAYER_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/android/compositor/layer/layer.h"
11
12 namespace cc {
13 class ImageLayer;
14 class Layer;
15 class NinePatchLayer;
16 class SolidColorLayer;
17 class UIResourceLayer;
18 }
19
20 namespace gfx {
21 class Size;
22 }
23
24 namespace ui {
25 class ResourceManager;
26 }
27
28 class SkBitmap;
29
30 namespace chrome {
31 namespace android {
32
33 class ContentLayer;
34 class DecorationTitle;
35 class LayerTitleCache;
36 class TabContentManager;
37 class ToolbarLayer;
38
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);
47
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 float toolbar_alpha,
89 float toolbar_y_offset,
90 float side_border_scale,
91 bool attach_content,
92 bool inset_border);
93
94 bool is_incognito() const { return incognito_; }
95
96 scoped_refptr<cc::Layer> layer() override;
97
98 protected:
99 TabLayer(bool incognito,
100 ui::ResourceManager* resource_manager,
101 LayerTitleCache* layer_title_cache,
102 TabContentManager* tab_content_manager);
103 ~TabLayer() override;
104
105 private:
106 void SetTitle(DecorationTitle* title);
107
108 const bool incognito_;
109 ui::ResourceManager* resource_manager_;
110 LayerTitleCache* layer_title_cache_;
111
112 // [layer]-+-[toolbar]
113 // +-[close button]
114 // +-[title]
115 // +-[front border]
116 // +-[content]
117 // +-[back_logo]
118 // +-[padding]
119 // +-[contour_shadow]
120 // +-[shadow]
121 //
122 // [back logo]
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_;
133 float brightness_;
134
135 DISALLOW_COPY_AND_ASSIGN(TabLayer);
136 };
137
138 } // namespace android
139 } // namespace chrome
140
141 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TAB_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698