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 #include "chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.h
" | 5 #include "chrome/browser/android/compositor/scene_layer/static_tab_scene_layer.h
" |
6 | 6 |
7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
8 #include "chrome/browser/android/compositor/layer/content_layer.h" | 8 #include "chrome/browser/android/compositor/layer/content_layer.h" |
9 #include "chrome/browser/android/compositor/layer_title_cache.h" | 9 #include "chrome/browser/android/compositor/layer_title_cache.h" |
10 #include "chrome/browser/android/compositor/tab_content_manager.h" | 10 #include "chrome/browser/android/compositor/tab_content_manager.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 if (content_scene_layer && content_scene_layer->layer()) { | 129 if (content_scene_layer && content_scene_layer->layer()) { |
130 content_scene_layer_ = content_scene_layer->layer(); | 130 content_scene_layer_ = content_scene_layer->layer(); |
131 if (content_scene_layer_.get()) | 131 if (content_scene_layer_.get()) |
132 layer_->AddChild(content_scene_layer_); | 132 layer_->AddChild(content_scene_layer_); |
133 } else if (content_scene_layer_) { | 133 } else if (content_scene_layer_) { |
134 content_scene_layer_->RemoveFromParent(); | 134 content_scene_layer_->RemoveFromParent(); |
135 content_scene_layer_ = nullptr; | 135 content_scene_layer_ = nullptr; |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 static jlong Init(JNIEnv* env, jobject jobj) { | 139 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jobj) { |
140 // This will automatically bind to the Java object and pass ownership there. | 140 // This will automatically bind to the Java object and pass ownership there. |
141 StaticTabSceneLayer* scene_layer = new StaticTabSceneLayer(env, jobj); | 141 StaticTabSceneLayer* scene_layer = new StaticTabSceneLayer(env, jobj); |
142 return reinterpret_cast<intptr_t>(scene_layer); | 142 return reinterpret_cast<intptr_t>(scene_layer); |
143 } | 143 } |
144 | 144 |
145 bool RegisterStaticTabSceneLayer(JNIEnv* env) { | 145 bool RegisterStaticTabSceneLayer(JNIEnv* env) { |
146 return RegisterNativesImpl(env); | 146 return RegisterNativesImpl(env); |
147 } | 147 } |
148 | 148 |
149 } // namespace android | 149 } // namespace android |
150 } // namespace chrome | 150 } // namespace chrome |
OLD | NEW |