| Index: chrome/browser/android/compositor/scene_layer/toolbar_scene_layer.h
|
| diff --git a/chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.h b/chrome/browser/android/compositor/scene_layer/toolbar_scene_layer.h
|
| similarity index 50%
|
| copy from chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.h
|
| copy to chrome/browser/android/compositor/scene_layer/toolbar_scene_layer.h
|
| index be9769ce23a39d4508092c6e2ed7f5cd7397dd50..2d2a2f58e3be08ee01934355ec1e5fc0857f6a53 100644
|
| --- a/chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.h
|
| +++ b/chrome/browser/android/compositor/scene_layer/toolbar_scene_layer.h
|
| @@ -1,64 +1,35 @@
|
| -// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_
|
| -#define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_
|
| -
|
| -#include <jni.h>
|
| +#ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_TOOLBAR_SCENE_LAYER_H_
|
| +#define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_TOOLBAR_SCENE_LAYER_H_
|
|
|
| #include <memory>
|
| +#include <vector>
|
|
|
| +#include "base/android/jni_android.h"
|
| #include "base/android/jni_weak_ref.h"
|
| #include "base/android/scoped_java_ref.h"
|
| #include "base/macros.h"
|
| -#include "base/memory/ref_counted.h"
|
| #include "chrome/browser/android/compositor/scene_layer/scene_layer.h"
|
| -#include "ui/gfx/geometry/point.h"
|
| -#include "ui/gfx/geometry/point_f.h"
|
| -#include "ui/gfx/geometry/size.h"
|
| -#include "ui/gfx/geometry/size_f.h"
|
| +#include "ui/android/resources/resource_manager_impl.h"
|
|
|
| namespace cc {
|
| class Layer;
|
| +class SolidColorLayer;
|
| }
|
|
|
| namespace chrome {
|
| namespace android {
|
|
|
| -class ContentLayer;
|
| class ToolbarLayer;
|
|
|
| -// A SceneLayer to render a static tab.
|
| -class StaticTabSceneLayer : public SceneLayer {
|
| +class ToolbarSceneLayer : public SceneLayer {
|
| public:
|
| - StaticTabSceneLayer(JNIEnv* env, jobject jobj);
|
| - ~StaticTabSceneLayer() override;
|
| -
|
| - bool ShouldShowBackground() override;
|
| - SkColor GetBackgroundColor() override;
|
| + ToolbarSceneLayer(JNIEnv* env, jobject jobj);
|
| + ~ToolbarSceneLayer() override;
|
|
|
| - // Update StaticTabSceneLayer with the new parameters.
|
| - void UpdateTabLayer(
|
| - JNIEnv* env,
|
| - const base::android::JavaParamRef<jobject>& jobj,
|
| - jfloat content_viewport_x,
|
| - jfloat content_viewport_y,
|
| - jfloat content_viewport_width,
|
| - jfloat content_viewport_height,
|
| - const base::android::JavaParamRef<jobject>& jtab_content_manager,
|
| - jint id,
|
| - jint toolbar_resource_id,
|
| - jboolean can_use_live_layer,
|
| - jint default_background_color,
|
| - jfloat x,
|
| - jfloat y,
|
| - jfloat width,
|
| - jfloat height,
|
| - jfloat content_offset_y,
|
| - jfloat static_to_view_blend,
|
| - jfloat saturation,
|
| - jfloat brightness);
|
| // Update the compositor version of the toolbar.
|
| void UpdateToolbarLayer(
|
| JNIEnv* env,
|
| @@ -71,6 +42,7 @@ class StaticTabSceneLayer : public SceneLayer {
|
| jfloat top_offset,
|
| bool visible,
|
| bool show_shadow);
|
| +
|
| // Update the progress bar.
|
| void UpdateProgressBar(
|
| JNIEnv* env,
|
| @@ -86,21 +58,27 @@ class StaticTabSceneLayer : public SceneLayer {
|
| jint progress_bar_background_height,
|
| jint progress_bar_background_color);
|
|
|
| + void SetContentTree(
|
| + JNIEnv* env,
|
| + const base::android::JavaParamRef<jobject>& jobj,
|
| + const base::android::JavaParamRef<jobject>& jcontent_tree);
|
| +
|
| + SkColor GetBackgroundColor() override;
|
| +
|
| + bool ShouldShowBackground() override;
|
| +
|
| private:
|
| - scoped_refptr<chrome::android::ContentLayer> content_layer_;
|
| - scoped_refptr<cc::Layer> content_scene_layer_;
|
| + bool should_show_background_;
|
| + SkColor background_color_;
|
| + scoped_refptr<cc::Layer> content_container_;
|
| scoped_refptr<ToolbarLayer> toolbar_layer_;
|
|
|
| - int last_set_tab_id_;
|
| - int background_color_;
|
| - float brightness_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(StaticTabSceneLayer);
|
| + DISALLOW_COPY_AND_ASSIGN(ToolbarSceneLayer);
|
| };
|
|
|
| -bool RegisterStaticTabSceneLayer(JNIEnv* env);
|
| +bool RegisterToolbarSceneLayer(JNIEnv* env);
|
|
|
| } // namespace android
|
| } // namespace chrome
|
|
|
| -#endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_STATIC_TAB_SCENE_LAYER_H_
|
| +#endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_TOOLBAR_SCENE_LAYER_H_
|
|
|