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

Side by Side Diff: webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc

Issue 17550008: Make IsSolidColor() a property on CC scrollbar layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make color setting work properly. Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h" 5 #include "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h"
6 6
7 #include "cc/base/switches.h"
7 #include "cc/layers/scrollbar_layer.h" 8 #include "cc/layers/scrollbar_layer.h"
8 #include "third_party/WebKit/public/platform/WebScrollbar.h" 9 #include "third_party/WebKit/public/platform/WebScrollbar.h"
9 #include "webkit/renderer/compositor_bindings/scrollbar_impl.h" 10 #include "webkit/renderer/compositor_bindings/scrollbar_impl.h"
10 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" 11 #include "webkit/renderer/compositor_bindings/web_layer_impl.h"
11 12
12 using cc::ScrollbarLayer; 13 using cc::ScrollbarLayer;
13 14
14 namespace webkit { 15 namespace webkit {
15 16
17 static bool ForceSolidColorScrollbars() {
18 return cc::switches::ForceSolidColorScrollbars();
19 }
20
16 WebScrollbarLayerImpl::WebScrollbarLayerImpl( 21 WebScrollbarLayerImpl::WebScrollbarLayerImpl(
17 WebKit::WebScrollbar* scrollbar, 22 WebKit::WebScrollbar* scrollbar,
18 WebKit::WebScrollbarThemePainter painter, 23 WebKit::WebScrollbarThemePainter painter,
19 WebKit::WebScrollbarThemeGeometry* geometry) 24 WebKit::WebScrollbarThemeGeometry* geometry)
20 : layer_(new WebLayerImpl(ScrollbarLayer::Create( 25 : layer_(new WebLayerImpl(
21 scoped_ptr<cc::Scrollbar>(new ScrollbarImpl( 26 ScrollbarLayer::Create(scoped_ptr<cc::Scrollbar>(new ScrollbarImpl(
22 make_scoped_ptr(scrollbar), 27 make_scoped_ptr(scrollbar),
23 painter, 28 painter,
24 make_scoped_ptr(geometry))).Pass(), 0))) {} 29 make_scoped_ptr(geometry))).Pass(),
30 0,
31 ForceSolidColorScrollbars()))) {}
jochen (gone - plz use gerrit) 2013/06/30 08:13:07 why not just invoking cc::switches::ForceSolidColo
wjmaclean 2013/07/02 13:50:31 Done.
25 32
26 WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {} 33 WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {}
27 34
28 WebKit::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } 35 WebKit::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); }
29 36
30 void WebScrollbarLayerImpl::setScrollLayer(WebKit::WebLayer* layer) { 37 void WebScrollbarLayerImpl::setScrollLayer(WebKit::WebLayer* layer) {
31 int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0; 38 int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0;
32 static_cast<ScrollbarLayer*>(layer_->layer())->SetScrollLayerId(id); 39 static_cast<ScrollbarLayer*>(layer_->layer())->SetScrollLayerId(id);
33 } 40 }
34 41
35 } // namespace webkit 42 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698