OLD | NEW |
---|---|
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_CONTEXTUAL_SEARCH_SCENE_LA YER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_CONTEXTUAL_SEARCH_SCENE_LA YER_H_ |
6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_CONTEXTUAL_SEARCH_SCENE_LA YER_H_ | 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_CONTEXTUAL_SEARCH_SCENE_LA YER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
12 #include "base/android/jni_weak_ref.h" | 12 #include "base/android/jni_weak_ref.h" |
13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
14 #include "base/macros.h" | 14 #include "base/macros.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 "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" | |
16 | 17 |
17 namespace cc { | 18 namespace cc { |
18 class Layer; | 19 class Layer; |
19 class SolidColorLayer; | 20 class SolidColorLayer; |
20 } | 21 } |
21 | 22 |
22 namespace chrome { | 23 namespace chrome { |
23 namespace android { | 24 namespace android { |
24 | 25 |
25 class ContextualSearchLayer; | 26 class ContextualSearchLayer; |
26 | 27 |
27 class ContextualSearchSceneLayer : public SceneLayer { | 28 class ContextualSearchSceneLayer : public SceneLayer, |
29 public chrome::BitmapFetcherDelegate { | |
28 public: | 30 public: |
29 ContextualSearchSceneLayer(JNIEnv* env, jobject jobj); | 31 ContextualSearchSceneLayer(JNIEnv* env, jobject jobj); |
30 ~ContextualSearchSceneLayer() override; | 32 ~ContextualSearchSceneLayer() override; |
31 | 33 |
32 void CreateContextualSearchLayer( | 34 void CreateContextualSearchLayer( |
33 JNIEnv* env, | 35 JNIEnv* env, |
34 const base::android::JavaParamRef<jobject>& object, | 36 const base::android::JavaParamRef<jobject>& object, |
35 const base::android::JavaParamRef<jobject>& jresource_manager); | 37 const base::android::JavaParamRef<jobject>& jresource_manager); |
36 | 38 |
37 void UpdateContextualSearchLayer( | 39 void UpdateContextualSearchLayer( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 jfloat search_context_opacity, | 75 jfloat search_context_opacity, |
74 jfloat search_term_opacity, | 76 jfloat search_term_opacity, |
75 jfloat search_caption_animation_percentage, | 77 jfloat search_caption_animation_percentage, |
76 jboolean search_caption_visible, | 78 jboolean search_caption_visible, |
77 jboolean search_bar_border_visible, | 79 jboolean search_bar_border_visible, |
78 jfloat search_bar_border_height, | 80 jfloat search_bar_border_height, |
79 jboolean search_bar_shadow_visible, | 81 jboolean search_bar_shadow_visible, |
80 jfloat search_bar_shadow_opacity, | 82 jfloat search_bar_shadow_opacity, |
81 jboolean search_provider_icon_sprite_visible, | 83 jboolean search_provider_icon_sprite_visible, |
82 jfloat search_provider_icon_sprite_completion_percentage, | 84 jfloat search_provider_icon_sprite_completion_percentage, |
85 jboolean thumbnail_visible, | |
86 jint thumbnail_size, | |
87 jstring j_thumbnail_url, | |
83 jfloat arrow_icon_opacity, | 88 jfloat arrow_icon_opacity, |
84 jfloat arrow_icon_rotation, | 89 jfloat arrow_icon_rotation, |
85 jfloat close_icon_opacity, | 90 jfloat close_icon_opacity, |
86 jboolean progress_bar_visible, | 91 jboolean progress_bar_visible, |
87 jfloat progress_bar_height, | 92 jfloat progress_bar_height, |
88 jfloat progress_bar_opacity, | 93 jfloat progress_bar_opacity, |
89 jint progress_bar_completion); | 94 jint progress_bar_completion, |
95 jobject j_profile); | |
96 | |
97 // Inherited from BitmapFetcherDelegate | |
98 void OnFetchComplete( | |
99 const GURL& url, | |
100 const SkBitmap* bitmap) override; | |
90 | 101 |
91 void SetContentTree( | 102 void SetContentTree( |
92 JNIEnv* env, | 103 JNIEnv* env, |
93 const base::android::JavaParamRef<jobject>& jobj, | 104 const base::android::JavaParamRef<jobject>& jobj, |
94 const base::android::JavaParamRef<jobject>& jcontent_tree); | 105 const base::android::JavaParamRef<jobject>& jcontent_tree); |
95 | 106 |
96 void HideTree( | 107 void HideTree( |
97 JNIEnv* env, | 108 JNIEnv* env, |
98 const base::android::JavaParamRef<jobject>& jobj); | 109 const base::android::JavaParamRef<jobject>& jobj); |
99 | 110 |
100 private: | 111 private: |
112 JNIEnv* env_; | |
113 base::android::ScopedJavaGlobalRef<jobject> object_; | |
101 float base_page_brightness_; | 114 float base_page_brightness_; |
115 std::string thumbnail_url_; | |
102 | 116 |
103 scoped_refptr<ContextualSearchLayer> contextual_search_layer_; | 117 scoped_refptr<ContextualSearchLayer> contextual_search_layer_; |
104 scoped_refptr<cc::Layer> content_container_; | 118 scoped_refptr<cc::Layer> content_container_; |
105 | 119 |
120 void FetchThumbnail(jobject j_profile); | |
Donn Denman
2016/09/08 18:13:39
nit: move up to top of private? IIRC we normally
Theresa
2016/09/08 20:18:23
Done.
| |
121 | |
106 DISALLOW_COPY_AND_ASSIGN(ContextualSearchSceneLayer); | 122 DISALLOW_COPY_AND_ASSIGN(ContextualSearchSceneLayer); |
107 }; | 123 }; |
108 | 124 |
109 bool RegisterContextualSearchSceneLayer(JNIEnv* env); | 125 bool RegisterContextualSearchSceneLayer(JNIEnv* env); |
110 | 126 |
111 } // namespace android | 127 } // namespace android |
112 } // namespace chrome | 128 } // namespace chrome |
113 | 129 |
114 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_CONTEXTUAL_SEARCH_SCENE _LAYER_H_ | 130 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_SCENE_LAYER_CONTEXTUAL_SEARCH_SCENE _LAYER_H_ |
OLD | NEW |