OLD | NEW |
---|---|
(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_DECORATION_TITLE_H_ | |
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_DECORATION_TITLE_H_ | |
7 | |
8 #include <jni.h> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "cc/resources/ui_resource_client.h" | |
13 #include "third_party/skia/include/core/SkBitmap.h" | |
14 #include "ui/gfx/size.h" | |
15 #include "ui/gfx/transform.h" | |
16 | |
17 namespace cc { | |
18 class Layer; | |
19 class UIResourceLayer; | |
20 } | |
21 | |
22 namespace ui { | |
23 class ResourceManager; | |
24 } | |
25 | |
26 namespace chrome { | |
27 namespace android { | |
28 | |
29 class LayerTitleCache; | |
30 | |
31 class DecorationTitle { | |
Nico
2015/07/22 18:12:14
(A short class comment describing what this does w
| |
32 public: | |
33 DecorationTitle(LayerTitleCache* layer_title_cache, | |
34 ui::ResourceManager* resource_manager, | |
35 int title_resource_id, | |
36 int favicon_resource_id, | |
37 int spinner_resource_id, | |
38 int spinner_resource_id_incognito, | |
39 int fade_width, | |
40 int favicon_start_padding, | |
41 int favicon_end_padding, | |
42 bool is_incognito, | |
43 bool is_rtl); | |
44 virtual ~DecorationTitle(); | |
45 | |
46 void SetResourceManager(ui::ResourceManager* resource_manager); | |
47 | |
48 void Update(int title_resource_id, | |
49 int favicon_resource_id, | |
50 int fade_width, | |
51 int favicon_start_padding, | |
52 int favicon_end_padding, | |
53 bool is_incognito, | |
54 bool is_rtl); | |
55 void SetUIResourceIds(); | |
56 void SetIsLoading(bool is_loading); | |
57 void SetSpinnerRotation(float rotation); | |
58 void setBounds(const gfx::Size& bounds); | |
59 void setOpacity(float opacity); | |
60 | |
61 scoped_refptr<cc::Layer> layer(); | |
62 const gfx::Size& size() { return size_; } | |
63 | |
64 private: | |
65 scoped_refptr<cc::Layer> layer_; | |
66 scoped_refptr<cc::UIResourceLayer> layer_opaque_; | |
67 scoped_refptr<cc::UIResourceLayer> layer_fade_; | |
68 scoped_refptr<cc::UIResourceLayer> layer_favicon_; | |
69 | |
70 int title_resource_id_; | |
71 int favicon_resource_id_; | |
72 int spinner_resource_id_; | |
73 int spinner_incognito_resource_id_; | |
74 | |
75 gfx::Size title_size_; | |
76 gfx::Size favicon_size_; | |
77 gfx::Size size_; | |
78 int fade_width_; | |
79 float spinner_rotation_; | |
80 int favicon_start_padding_; | |
81 int favicon_end_padding_; | |
82 bool is_incognito_; | |
83 bool is_rtl_; | |
84 bool is_loading_; | |
85 scoped_ptr<gfx::Transform> transform_; | |
86 | |
87 ui::ResourceManager* resource_manager_; | |
88 | |
89 LayerTitleCache* layer_title_cache_; | |
90 | |
91 DISALLOW_COPY_AND_ASSIGN(DecorationTitle); | |
92 }; | |
93 | |
94 } // namespace android | |
95 } // namespace chrome | |
96 | |
97 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_DECORATION_TITLE_H_ | |
OLD | NEW |