Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / android / compositor / decoration_title.h
blobf5c46e91e560e08b82bfd760fc6b04156714aa01
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_
8 #include <jni.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"
17 namespace cc {
18 class Layer;
19 class UIResourceLayer;
22 namespace ui {
23 class ResourceManager;
26 namespace chrome {
27 namespace android {
29 class LayerTitleCache;
31 class DecorationTitle {
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();
46 void SetResourceManager(ui::ResourceManager* resource_manager);
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);
61 scoped_refptr<cc::Layer> layer();
62 const gfx::Size& size() { return size_; }
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_;
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_;
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_;
87 ui::ResourceManager* resource_manager_;
89 LayerTitleCache* layer_title_cache_;
91 DISALLOW_COPY_AND_ASSIGN(DecorationTitle);
94 } // namespace android
95 } // namespace chrome
97 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_DECORATION_TITLE_H_