OLD | NEW |
| (Empty) |
1 // Copyright 2016 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 #include "chrome/browser/android/compositor/layer/reader_mode_layer.h" | |
6 | |
7 #include "cc/layers/layer.h" | |
8 #include "cc/resources/scoped_ui_resource.h" | |
9 #include "content/public/browser/android/compositor.h" | |
10 #include "ui/android/resources/resource_manager.h" | |
11 | |
12 namespace android { | |
13 | |
14 // static | |
15 scoped_refptr<ReaderModeLayer> ReaderModeLayer::Create( | |
16 ui::ResourceManager* resource_manager) { | |
17 return make_scoped_refptr(new ReaderModeLayer(resource_manager)); | |
18 } | |
19 | |
20 void ReaderModeLayer::SetProperties( | |
21 float dp_to_px, | |
22 const scoped_refptr<cc::Layer>& content_layer, | |
23 float panel_x, | |
24 float panel_y, | |
25 float panel_width, | |
26 float panel_height, | |
27 float bar_margin_side, | |
28 float bar_height, | |
29 float text_opacity, | |
30 bool bar_border_visible, | |
31 float bar_border_height, | |
32 bool bar_shadow_visible, | |
33 float bar_shadow_opacity) { | |
34 // Round values to avoid pixel gap between layers. | |
35 bar_height = floor(bar_height); | |
36 | |
37 OverlayPanelLayer::SetProperties( | |
38 dp_to_px, content_layer, bar_height, panel_x, panel_y, panel_width, | |
39 panel_height, bar_margin_side, bar_height, 0.0f, text_opacity, | |
40 bar_border_visible, bar_border_height, bar_shadow_visible, | |
41 bar_shadow_opacity, 1.0f, 0, 0); | |
42 } | |
43 | |
44 ReaderModeLayer::ReaderModeLayer( | |
45 ui::ResourceManager* resource_manager) | |
46 : OverlayPanelLayer(resource_manager) { | |
47 } | |
48 | |
49 ReaderModeLayer::~ReaderModeLayer() { | |
50 } | |
51 | |
52 } // namespace android | |
OLD | NEW |