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(ui::ResourceManager::Resource* resource, |
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); |
36 | 40 |
37 void UpdateProgressBar(int progress_bar_x, | 41 void UpdateProgressBar(int progress_bar_x, |
38 int progress_bar_y, | 42 int progress_bar_y, |
39 int progress_bar_width, | 43 int progress_bar_width, |
40 int progress_bar_height, | 44 int progress_bar_height, |
41 int progress_bar_color, | 45 int progress_bar_color, |
42 int progress_bar_background_x, | 46 int progress_bar_background_x, |
43 int progress_bar_background_y, | 47 int progress_bar_background_y, |
44 int progress_bar_background_width, | 48 int progress_bar_background_width, |
45 int progress_bar_background_height, | 49 int progress_bar_background_height, |
46 int progress_bar_background_color); | 50 int progress_bar_background_color); |
47 | 51 |
48 protected: | 52 protected: |
49 ToolbarLayer(); | 53 explicit ToolbarLayer(ui::ResourceManager* resource_manager); |
50 ~ToolbarLayer() override; | 54 ~ToolbarLayer() override; |
51 | 55 |
52 private: | 56 private: |
57 ui::ResourceManager* resource_manager_; | |
David Trainor- moved to gerrit
2015/11/02 16:25:08
If we're going to save the resource manager, we mi
aurimas (slooooooooow)
2015/11/02 19:31:46
Done
| |
58 | |
53 scoped_refptr<cc::Layer> layer_; | 59 scoped_refptr<cc::Layer> layer_; |
54 scoped_refptr<cc::SolidColorLayer> toolbar_background_layer_; | 60 scoped_refptr<cc::SolidColorLayer> toolbar_background_layer_; |
61 scoped_refptr<cc::NinePatchLayer> url_bar_background_layer_; | |
55 scoped_refptr<cc::UIResourceLayer> bitmap_layer_; | 62 scoped_refptr<cc::UIResourceLayer> bitmap_layer_; |
56 scoped_refptr<cc::SolidColorLayer> progress_bar_layer_; | 63 scoped_refptr<cc::SolidColorLayer> progress_bar_layer_; |
57 scoped_refptr<cc::SolidColorLayer> progress_bar_background_layer_; | 64 scoped_refptr<cc::SolidColorLayer> progress_bar_background_layer_; |
58 scoped_refptr<cc::SolidColorLayer> anonymize_layer_; | 65 scoped_refptr<cc::SolidColorLayer> anonymize_layer_; |
59 scoped_refptr<cc::SolidColorLayer> debug_layer_; | 66 scoped_refptr<cc::SolidColorLayer> debug_layer_; |
60 float brightness_; | 67 float brightness_; |
61 | 68 |
62 DISALLOW_COPY_AND_ASSIGN(ToolbarLayer); | 69 DISALLOW_COPY_AND_ASSIGN(ToolbarLayer); |
63 }; | 70 }; |
64 | 71 |
65 } // namespace android | 72 } // namespace android |
66 } // namespace chrome | 73 } // namespace chrome |
67 | 74 |
68 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TOOLBAR_LAYER_H_ | 75 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_TOOLBAR_LAYER_H_ |
OLD | NEW |