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 #include "chrome/browser/android/compositor/scene_layer/reader_mode_scene_layer.
h" | 5 #include "chrome/browser/android/compositor/scene_layer/reader_mode_scene_layer.
h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "cc/layers/solid_color_layer.h" | 9 #include "cc/layers/solid_color_layer.h" |
10 #include "chrome/browser/android/compositor/layer/reader_mode_layer.h" | 10 #include "chrome/browser/android/compositor/layer/reader_mode_layer.h" |
11 #include "content/public/browser/android/compositor.h" | 11 #include "content/public/browser/android/compositor.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 #include "jni/ReaderModeSceneLayer_jni.h" | 13 #include "jni/ReaderModeSceneLayer_jni.h" |
14 #include "ui/android/resources/resource_manager_impl.h" | 14 #include "ui/android/resources/resource_manager_impl.h" |
15 #include "ui/android/view_android.h" | 15 #include "ui/android/view_android.h" |
16 #include "ui/gfx/android/java_bitmap.h" | 16 #include "ui/gfx/android/java_bitmap.h" |
17 | 17 |
| 18 using base::android::JavaParamRef; |
| 19 |
18 namespace chrome { | 20 namespace chrome { |
19 namespace android { | 21 namespace android { |
20 | 22 |
21 ReaderModeSceneLayer::ReaderModeSceneLayer(JNIEnv* env, jobject jobj) | 23 ReaderModeSceneLayer::ReaderModeSceneLayer(JNIEnv* env, jobject jobj) |
22 : SceneLayer(env, jobj), | 24 : SceneLayer(env, jobj), |
23 base_page_brightness_(1.0f), | 25 base_page_brightness_(1.0f), |
24 content_container_(cc::Layer::Create()) { | 26 content_container_(cc::Layer::Create()) { |
25 // Responsible for moving the base page without modifying the layer itself. | 27 // Responsible for moving the base page without modifying the layer itself. |
26 content_container_->SetIsDrawable(true); | 28 content_container_->SetIsDrawable(true); |
27 content_container_->SetPosition(gfx::PointF(0.0f, 0.0f)); | 29 content_container_->SetPosition(gfx::PointF(0.0f, 0.0f)); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 new ReaderModeSceneLayer(env, jobj); | 157 new ReaderModeSceneLayer(env, jobj); |
156 return reinterpret_cast<intptr_t>(reader_mode_scene_layer); | 158 return reinterpret_cast<intptr_t>(reader_mode_scene_layer); |
157 } | 159 } |
158 | 160 |
159 bool RegisterReaderModeSceneLayer(JNIEnv* env) { | 161 bool RegisterReaderModeSceneLayer(JNIEnv* env) { |
160 return RegisterNativesImpl(env); | 162 return RegisterNativesImpl(env); |
161 } | 163 } |
162 | 164 |
163 } // namespace android | 165 } // namespace android |
164 } // namespace chrome | 166 } // namespace chrome |
OLD | NEW |