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

Side by Side Diff: chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.cc

Issue 2707403004: Unify background color gutters. (Closed)
Patch Set: Rebase Created 3 years, 9 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 #include "chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.h" 5 #include "chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "cc/resources/scoped_ui_resource.h" 8 #include "cc/resources/scoped_ui_resource.h"
9 #include "chrome/browser/android/compositor/layer/tab_handle_layer.h" 9 #include "chrome/browser/android/compositor/layer/tab_handle_layer.h"
10 #include "chrome/browser/android/compositor/layer_title_cache.h" 10 #include "chrome/browser/android/compositor/layer_title_cache.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 return tab_handle_layers_[write_index_++]; 311 return tab_handle_layers_[write_index_++];
312 312
313 scoped_refptr<TabHandleLayer> layer_tree = 313 scoped_refptr<TabHandleLayer> layer_tree =
314 TabHandleLayer::Create(layer_title_cache); 314 TabHandleLayer::Create(layer_title_cache);
315 tab_handle_layers_.push_back(layer_tree); 315 tab_handle_layers_.push_back(layer_tree);
316 scrollable_strip_layer_->AddChild(layer_tree->layer()); 316 scrollable_strip_layer_->AddChild(layer_tree->layer());
317 write_index_++; 317 write_index_++;
318 return layer_tree; 318 return layer_tree;
319 } 319 }
320 320
321 bool TabStripSceneLayer::ShouldShowBackground() {
322 if (content_tree_)
323 return content_tree_->ShouldShowBackground();
324 return SceneLayer::ShouldShowBackground();
325 }
326
327 SkColor TabStripSceneLayer::GetBackgroundColor() {
328 if (content_tree_)
329 return content_tree_->GetBackgroundColor();
330 return SceneLayer::GetBackgroundColor();
331 }
332
321 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jobj) { 333 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jobj) {
322 // This will automatically bind to the Java object and pass ownership there. 334 // This will automatically bind to the Java object and pass ownership there.
323 TabStripSceneLayer* scene_layer = new TabStripSceneLayer(env, jobj); 335 TabStripSceneLayer* scene_layer = new TabStripSceneLayer(env, jobj);
324 return reinterpret_cast<intptr_t>(scene_layer); 336 return reinterpret_cast<intptr_t>(scene_layer);
325 } 337 }
326 338
327 bool RegisterTabStripSceneLayer(JNIEnv* env) { 339 bool RegisterTabStripSceneLayer(JNIEnv* env) {
328 return RegisterNativesImpl(env); 340 return RegisterNativesImpl(env);
329 } 341 }
330 342
331 } // namespace android 343 } // namespace android
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698