OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TOOLBAR_LAYER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TOOLBAR_LAYER_H_ |
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TOOLBAR_LAYER_H_ | 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TOOLBAR_LAYER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "cc/layers/nine_patch_layer.h" |
11 #include "chrome/browser/android/compositor/layer/layer.h" | 12 #include "chrome/browser/android/compositor/layer/layer.h" |
12 #include "ui/android/resources/resource_manager.h" | 13 #include "ui/android/resources/resource_manager.h" |
13 | 14 |
14 namespace cc { | 15 namespace cc { |
15 class Layer; | 16 class Layer; |
16 class SolidColorLayer; | 17 class SolidColorLayer; |
17 class UIResourceLayer; | 18 class UIResourceLayer; |
18 } | 19 } |
19 | 20 |
20 namespace chrome { | 21 namespace chrome { |
21 namespace android { | 22 namespace android { |
22 | 23 |
23 class ToolbarLayer : public Layer { | 24 class ToolbarLayer : public Layer { |
24 public: | 25 public: |
25 static scoped_refptr<ToolbarLayer> Create(); | 26 static scoped_refptr<ToolbarLayer> Create( |
| 27 ui::ResourceManager* resource_manager); |
26 | 28 |
27 // Implements Layer | 29 // Implements Layer |
28 scoped_refptr<cc::Layer> layer() override; | 30 scoped_refptr<cc::Layer> layer() override; |
29 | 31 |
30 void PushResource(ui::ResourceManager::Resource* resource, | 32 void PushResource(int toolbar_resource_id, |
31 int toolbar_background_color, | 33 int toolbar_background_color, |
32 bool anonymize, | 34 bool anonymize, |
33 int toolbar_textbox_background_color, | 35 int toolbar_textbox_background_color, |
| 36 int url_bar_background_resource_id, |
| 37 float url_bar_alpha, |
34 bool show_debug, | 38 bool show_debug, |
35 float brightness); | 39 float brightness, |
| 40 bool clip_shadow); |
36 | 41 |
37 void UpdateProgressBar(int progress_bar_x, | 42 void UpdateProgressBar(int progress_bar_x, |
38 int progress_bar_y, | 43 int progress_bar_y, |
39 int progress_bar_width, | 44 int progress_bar_width, |
40 int progress_bar_height, | 45 int progress_bar_height, |
41 int progress_bar_color, | 46 int progress_bar_color, |
42 int progress_bar_background_x, | 47 int progress_bar_background_x, |
43 int progress_bar_background_y, | 48 int progress_bar_background_y, |
44 int progress_bar_background_width, | 49 int progress_bar_background_width, |
45 int progress_bar_background_height, | 50 int progress_bar_background_height, |
46 int progress_bar_background_color); | 51 int progress_bar_background_color); |
47 | 52 |
48 protected: | 53 protected: |
49 ToolbarLayer(); | 54 explicit ToolbarLayer(ui::ResourceManager* resource_manager); |
50 ~ToolbarLayer() override; | 55 ~ToolbarLayer() override; |
51 | 56 |
52 private: | 57 private: |
| 58 ui::ResourceManager* resource_manager_; |
| 59 |
53 scoped_refptr<cc::Layer> layer_; | 60 scoped_refptr<cc::Layer> layer_; |
54 scoped_refptr<cc::SolidColorLayer> toolbar_background_layer_; | 61 scoped_refptr<cc::SolidColorLayer> toolbar_background_layer_; |
| 62 scoped_refptr<cc::NinePatchLayer> url_bar_background_layer_; |
55 scoped_refptr<cc::UIResourceLayer> bitmap_layer_; | 63 scoped_refptr<cc::UIResourceLayer> bitmap_layer_; |
56 scoped_refptr<cc::SolidColorLayer> progress_bar_layer_; | 64 scoped_refptr<cc::SolidColorLayer> progress_bar_layer_; |
57 scoped_refptr<cc::SolidColorLayer> progress_bar_background_layer_; | 65 scoped_refptr<cc::SolidColorLayer> progress_bar_background_layer_; |
58 scoped_refptr<cc::SolidColorLayer> anonymize_layer_; | 66 scoped_refptr<cc::SolidColorLayer> anonymize_layer_; |
59 scoped_refptr<cc::SolidColorLayer> debug_layer_; | 67 scoped_refptr<cc::SolidColorLayer> debug_layer_; |
60 float brightness_; | 68 float brightness_; |
61 | 69 |
62 DISALLOW_COPY_AND_ASSIGN(ToolbarLayer); | 70 DISALLOW_COPY_AND_ASSIGN(ToolbarLayer); |
63 }; | 71 }; |
64 | 72 |
65 } // namespace android | 73 } // namespace android |
66 } // namespace chrome | 74 } // namespace chrome |
67 | 75 |
68 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TOOLBAR_LAYER_H_ | 76 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TOOLBAR_LAYER_H_ |
OLD | NEW |