OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "base/android/jni_weak_ref.h" |
| 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/basictypes.h" |
| 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "chrome/browser/android/compositor/scene_layer/scene_layer.h" |
| 16 #include "ui/gfx/geometry/point.h" |
| 17 #include "ui/gfx/geometry/point_f.h" |
| 18 #include "ui/gfx/geometry/size.h" |
| 19 #include "ui/gfx/geometry/size_f.h" |
| 20 |
| 21 namespace cc { |
| 22 class Layer; |
| 23 } |
| 24 |
| 25 namespace chrome { |
| 26 namespace android { |
| 27 |
| 28 class ContentLayer; |
| 29 |
| 30 // A SceneLayer to render a static tab. |
| 31 class StaticTabSceneLayer : public SceneLayer { |
| 32 public: |
| 33 StaticTabSceneLayer(JNIEnv* env, jobject jobj); |
| 34 ~StaticTabSceneLayer() override; |
| 35 |
| 36 bool ShouldShowBackground() override; |
| 37 SkColor GetBackgroundColor() override; |
| 38 |
| 39 // Update StaticTabSceneLayer with the new parameters. |
| 40 void UpdateTabLayer(JNIEnv* env, |
| 41 jobject jobj, |
| 42 jfloat content_viewport_x, |
| 43 jfloat content_viewport_y, |
| 44 jfloat content_viewport_width, |
| 45 jfloat content_viewport_height, |
| 46 jobject jtab_content_manager, |
| 47 jint id, |
| 48 jint toolbar_resource_id, |
| 49 jboolean can_use_live_layer, |
| 50 jboolean can_use_ntp_fallback, |
| 51 jint default_background_color, |
| 52 jfloat x, |
| 53 jfloat y, |
| 54 jfloat width, |
| 55 jfloat height, |
| 56 jfloat content_offset_y, |
| 57 jfloat static_to_view_blend, |
| 58 jfloat saturation); |
| 59 |
| 60 // Set the given |jscene_layer| as content of this SceneLayer, along with its |
| 61 // own content. |
| 62 void SetContentSceneLayer(JNIEnv* env, jobject jobj, jobject jscene_layer); |
| 63 |
| 64 private: |
| 65 scoped_refptr<chrome::android::ContentLayer> content_layer_; |
| 66 scoped_refptr<cc::Layer> content_scene_layer_; |
| 67 |
| 68 int last_set_tab_id_; |
| 69 int background_color_; |
| 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(StaticTabSceneLayer); |
| 72 }; |
| 73 |
| 74 bool RegisterStaticTabSceneLayer(JNIEnv* env); |
| 75 |
| 76 } // namespace android |
| 77 } // namespace chrome |
| 78 |
| 79 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_
H_ |
OLD | NEW |