OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_SCENE_LAYER_READER_MODE_SCENE_LAYER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_READER_MODE_SCENE_LAYER_H_ |
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_READER_MODE_SCENE_LAYER_H_ | 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_READER_MODE_SCENE_LAYER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
12 #include "base/android/jni_weak_ref.h" | 12 #include "base/android/jni_weak_ref.h" |
13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "chrome/browser/android/compositor/scene_layer/scene_layer.h" | 15 #include "chrome/browser/android/compositor/scene_layer/scene_layer.h" |
16 #include "ui/android/resources/resource_manager_impl.h" | 16 #include "ui/android/resources/resource_manager_impl.h" |
17 | 17 |
| 18 namespace cc { |
| 19 class Layer; |
| 20 class SolidColorLayer; |
| 21 } |
| 22 |
18 namespace chrome { | 23 namespace chrome { |
19 namespace android { | 24 namespace android { |
20 | 25 |
21 class ReaderModeLayer; | 26 class ReaderModeLayer; |
22 | 27 |
23 class ReaderModeSceneLayer : public SceneLayer { | 28 class ReaderModeSceneLayer : public SceneLayer { |
24 public: | 29 public: |
25 ReaderModeSceneLayer(JNIEnv* env, jobject jobj); | 30 ReaderModeSceneLayer(JNIEnv* env, jobject jobj); |
26 ~ReaderModeSceneLayer() override; | 31 ~ReaderModeSceneLayer() override; |
27 | 32 |
28 void CreateReaderModeLayer( | 33 void CreateReaderModeLayer( |
29 JNIEnv* env, | 34 JNIEnv* env, |
30 const base::android::JavaParamRef<jobject>& object, | 35 const base::android::JavaParamRef<jobject>& object, |
31 const base::android::JavaParamRef<jobject>& jresource_manager); | 36 const base::android::JavaParamRef<jobject>& jresource_manager); |
32 | 37 |
33 void SetResourceIds( | 38 void SetResourceIds( |
34 JNIEnv* env, | 39 JNIEnv* env, |
35 const base::android::JavaParamRef<jobject>& object, | 40 const base::android::JavaParamRef<jobject>& object, |
36 jint text_resource_id, | 41 jint text_resource_id, |
37 jint bar_background_resource_id, | 42 jint bar_background_resource_id, |
38 jint bar_shadow_resource_id, | 43 jint bar_shadow_resource_id, |
39 jint panel_icon_resource_id, | 44 jint panel_icon_resource_id, |
40 jint close_icon_resource_id); | 45 jint close_icon_resource_id); |
41 | 46 |
42 void Update( | 47 void Update( |
43 JNIEnv* env, | 48 JNIEnv* env, |
44 const base::android::JavaParamRef<jobject>& object, | 49 const base::android::JavaParamRef<jobject>& object, |
45 jfloat dp_to_px, | 50 jfloat dp_to_px, |
| 51 jfloat base_page_brightness, |
| 52 jfloat base_page_offset, |
46 const base::android::JavaParamRef<jobject>& jcontent_view_core, | 53 const base::android::JavaParamRef<jobject>& jcontent_view_core, |
47 jfloat panel_X, | 54 jfloat panel_X, |
48 jfloat panel_y, | 55 jfloat panel_y, |
49 jfloat panel_width, | 56 jfloat panel_width, |
50 jfloat panel_height, | 57 jfloat panel_height, |
51 jfloat bar_margin_side, | 58 jfloat bar_margin_side, |
52 jfloat bar_height, | 59 jfloat bar_height, |
53 jfloat text_opacity, | 60 jfloat text_opacity, |
54 jboolean bar_border_visible, | 61 jboolean bar_border_visible, |
55 jfloat bar_border_height, | 62 jfloat bar_border_height, |
56 jboolean bar_shadow_visible, | 63 jboolean bar_shadow_visible, |
57 jfloat bar_shadow_opacity); | 64 jfloat bar_shadow_opacity); |
58 | 65 |
| 66 void SetContentTree( |
| 67 JNIEnv* env, |
| 68 const base::android::JavaParamRef<jobject>& jobj, |
| 69 const base::android::JavaParamRef<jobject>& jcontent_tree); |
| 70 |
| 71 void HideTree( |
| 72 JNIEnv* env, |
| 73 const base::android::JavaParamRef<jobject>& jobj); |
| 74 |
59 private: | 75 private: |
| 76 float base_page_brightness_; |
| 77 |
| 78 scoped_refptr<cc::Layer> content_layer_; |
60 scoped_refptr<ReaderModeLayer> reader_mode_layer_; | 79 scoped_refptr<ReaderModeLayer> reader_mode_layer_; |
| 80 scoped_refptr<cc::SolidColorLayer> color_overlay_; |
| 81 scoped_refptr<cc::Layer> content_container_; |
61 | 82 |
62 DISALLOW_COPY_AND_ASSIGN(ReaderModeSceneLayer); | 83 DISALLOW_COPY_AND_ASSIGN(ReaderModeSceneLayer); |
63 }; | 84 }; |
64 | 85 |
65 bool RegisterReaderModeSceneLayer(JNIEnv* env); | 86 bool RegisterReaderModeSceneLayer(JNIEnv* env); |
66 | 87 |
67 } // namespace android | 88 } // namespace android |
68 } // namespace chrome | 89 } // namespace chrome |
69 | 90 |
70 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_READER_MODE_SCENE_LAYER
_H_ | 91 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_READER_MODE_SCENE_LAYER
_H_ |
OLD | NEW |