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_DECORATION_TITLE_H_
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_DECORATION_TITLE_H_
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/geometry/size.h"
15 #include "ui/gfx/transform.h"
19 class UIResourceLayer
;
23 class ResourceManager
;
29 class LayerTitleCache
;
31 class DecorationTitle
{
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
,
40 int favicon_start_padding
,
41 int favicon_end_padding
,
44 virtual ~DecorationTitle();
46 void SetResourceManager(ui::ResourceManager
* resource_manager
);
48 void Update(int title_resource_id
,
49 int favicon_resource_id
,
51 int favicon_start_padding
,
52 int favicon_end_padding
,
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
);
61 scoped_refptr
<cc::Layer
> layer();
62 const gfx::Size
& size() { return size_
; }
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_
;
70 int title_resource_id_
;
71 int favicon_resource_id_
;
72 int spinner_resource_id_
;
73 int spinner_incognito_resource_id_
;
75 gfx::Size title_size_
;
76 gfx::Size favicon_size_
;
79 float spinner_rotation_
;
80 int favicon_start_padding_
;
81 int favicon_end_padding_
;
85 scoped_ptr
<gfx::Transform
> transform_
;
87 ui::ResourceManager
* resource_manager_
;
89 LayerTitleCache
* layer_title_cache_
;
91 DISALLOW_COPY_AND_ASSIGN(DecorationTitle
);
94 } // namespace android
97 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_DECORATION_TITLE_H_