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.
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_
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"
30 // A SceneLayer to render a static tab.
31 class StaticTabSceneLayer
: public SceneLayer
{
33 StaticTabSceneLayer(JNIEnv
* env
, jobject jobj
);
34 ~StaticTabSceneLayer() override
;
36 bool ShouldShowBackground() override
;
37 SkColor
GetBackgroundColor() override
;
39 // Update StaticTabSceneLayer with the new parameters.
40 void UpdateTabLayer(JNIEnv
* env
,
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
,
48 jint toolbar_resource_id
,
49 jboolean can_use_live_layer
,
50 jboolean can_use_ntp_fallback
,
51 jint default_background_color
,
56 jfloat content_offset_y
,
57 jfloat static_to_view_blend
,
61 // Set the given |jscene_layer| as content of this SceneLayer, along with its
63 void SetContentSceneLayer(JNIEnv
* env
, jobject jobj
, jobject jscene_layer
);
66 scoped_refptr
<chrome::android::ContentLayer
> content_layer_
;
67 scoped_refptr
<cc::Layer
> content_scene_layer_
;
70 int background_color_
;
73 DISALLOW_COPY_AND_ASSIGN(StaticTabSceneLayer
);
76 bool RegisterStaticTabSceneLayer(JNIEnv
* env
);
78 } // namespace android
81 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_