Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / android / compositor / scene_layer / static_tab_scene_layer.h
bloba9c05704123a14882cb2eea1d01193793ab48e52
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_
8 #include <jni.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"
21 namespace cc {
22 class Layer;
25 namespace chrome {
26 namespace android {
28 class ContentLayer;
30 // A SceneLayer to render a static tab.
31 class StaticTabSceneLayer : public SceneLayer {
32 public:
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,
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 jfloat brightness);
61 // Set the given |jscene_layer| as content of this SceneLayer, along with its
62 // own content.
63 void SetContentSceneLayer(JNIEnv* env, jobject jobj, jobject jscene_layer);
65 private:
66 scoped_refptr<chrome::android::ContentLayer> content_layer_;
67 scoped_refptr<cc::Layer> content_scene_layer_;
69 int last_set_tab_id_;
70 int background_color_;
71 float brightness_;
73 DISALLOW_COPY_AND_ASSIGN(StaticTabSceneLayer);
76 bool RegisterStaticTabSceneLayer(JNIEnv* env);
78 } // namespace android
79 } // namespace chrome
81 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_