Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.h

Issue 1706293005: StaticTabSceneLayer owns ToolbarLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add toolbar layer when content tree set Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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_STATIC_TAB_SCENE_LAYER_H_ 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_ 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/jni_weak_ref.h" 10 #include "base/android/jni_weak_ref.h"
11 #include "base/android/scoped_java_ref.h" 11 #include "base/android/scoped_java_ref.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.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/gfx/geometry/point.h" 16 #include "ui/gfx/geometry/point.h"
17 #include "ui/gfx/geometry/point_f.h" 17 #include "ui/gfx/geometry/point_f.h"
18 #include "ui/gfx/geometry/size.h" 18 #include "ui/gfx/geometry/size.h"
19 #include "ui/gfx/geometry/size_f.h" 19 #include "ui/gfx/geometry/size_f.h"
20 20
21 namespace cc { 21 namespace cc {
22 class Layer; 22 class Layer;
23 } 23 }
24 24
25 namespace chrome { 25 namespace chrome {
26 namespace android { 26 namespace android {
27 27
28 class ContentLayer; 28 class ContentLayer;
29 class ToolbarLayer;
29 30
30 // A SceneLayer to render a static tab. 31 // A SceneLayer to render a static tab.
31 class StaticTabSceneLayer : public SceneLayer { 32 class StaticTabSceneLayer : public SceneLayer {
32 public: 33 public:
33 StaticTabSceneLayer(JNIEnv* env, jobject jobj); 34 StaticTabSceneLayer(JNIEnv* env, jobject jobj);
34 ~StaticTabSceneLayer() override; 35 ~StaticTabSceneLayer() override;
35 36
36 bool ShouldShowBackground() override; 37 bool ShouldShowBackground() override;
37 SkColor GetBackgroundColor() override; 38 SkColor GetBackgroundColor() override;
38 39
(...skipping 11 matching lines...) Expand all
50 jboolean can_use_live_layer, 51 jboolean can_use_live_layer,
51 jint default_background_color, 52 jint default_background_color,
52 jfloat x, 53 jfloat x,
53 jfloat y, 54 jfloat y,
54 jfloat width, 55 jfloat width,
55 jfloat height, 56 jfloat height,
56 jfloat content_offset_y, 57 jfloat content_offset_y,
57 jfloat static_to_view_blend, 58 jfloat static_to_view_blend,
58 jfloat saturation, 59 jfloat saturation,
59 jfloat brightness); 60 jfloat brightness);
61 // Update the compositor version of the toolbar.
62 void UpdateToolbarLayer(
63 JNIEnv* env,
64 const base::android::JavaParamRef<jobject>& object,
65 const base::android::JavaParamRef<jobject>& jresource_manager,
66 jint toolbar_resource_id,
67 jint toolbar_background_color,
68 jint url_bar_resource_id,
69 jfloat url_bar_alpha,
70 jfloat top_offset,
71 jfloat brightness,
72 bool visible,
73 bool show_shadow);
74 // Update the progress bar.
75 void UpdateProgressBar(
76 JNIEnv* env,
77 const base::android::JavaParamRef<jobject>& object,
78 jint progress_bar_x,
79 jint progress_bar_y,
80 jint progress_bar_width,
81 jint progress_bar_height,
82 jint progress_bar_color,
83 jint progress_bar_background_x,
84 jint progress_bar_background_y,
85 jint progress_bar_background_width,
86 jint progress_bar_background_height,
87 jint progress_bar_background_color);
60 88
61 // Set the given |jscene_layer| as content of this SceneLayer, along with its 89 // Set the given |jscene_layer| as content of this SceneLayer, along with its
62 // own content. 90 // own content.
63 void SetContentSceneLayer( 91 void SetContentSceneLayer(
64 JNIEnv* env, 92 JNIEnv* env,
65 const base::android::JavaParamRef<jobject>& jobj, 93 const base::android::JavaParamRef<jobject>& jobj,
66 const base::android::JavaParamRef<jobject>& jscene_layer); 94 const base::android::JavaParamRef<jobject>& jscene_layer);
67 95
68 private: 96 private:
69 scoped_refptr<chrome::android::ContentLayer> content_layer_; 97 scoped_refptr<chrome::android::ContentLayer> content_layer_;
70 scoped_refptr<cc::Layer> content_scene_layer_; 98 scoped_refptr<cc::Layer> content_scene_layer_;
99 scoped_refptr<ToolbarLayer> toolbar_layer_;
71 100
72 int last_set_tab_id_; 101 int last_set_tab_id_;
73 int background_color_; 102 int background_color_;
74 float brightness_; 103 float brightness_;
75 104
76 DISALLOW_COPY_AND_ASSIGN(StaticTabSceneLayer); 105 DISALLOW_COPY_AND_ASSIGN(StaticTabSceneLayer);
77 }; 106 };
78 107
79 bool RegisterStaticTabSceneLayer(JNIEnv* env); 108 bool RegisterStaticTabSceneLayer(JNIEnv* env);
80 109
81 } // namespace android 110 } // namespace android
82 } // namespace chrome 111 } // namespace chrome
83 112
84 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_ H_ 113 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698