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

Side by Side Diff: cc/layers/solid_color_scrollbar_layer.cc

Issue 18341009: Refactor cc scrollbar layers to separate solid-color vs desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile. Created 7 years, 3 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
« no previous file with comments | « cc/layers/solid_color_scrollbar_layer.h ('k') | cc/layers/solid_color_scrollbar_layer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/layers/solid_color_scrollbar_layer.h"
6
7 #include "base/memory/scoped_ptr.h"
8 #include "cc/layers/layer_impl.h"
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h"
10
11 namespace cc {
12
13 scoped_ptr<LayerImpl> SolidColorScrollbarLayer::CreateLayerImpl(
14 LayerTreeImpl* tree_impl) {
15 return SolidColorScrollbarLayerImpl::Create(
16 tree_impl, id(), orientation(), thumb_thickness_).PassAs<LayerImpl>();
17 }
18
19 scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create(
20 ScrollbarOrientation orientation,
21 int thumb_thickness,
22 int scroll_layer_id) {
23 return make_scoped_refptr(new SolidColorScrollbarLayer(orientation,
24 thumb_thickness,
25 scroll_layer_id));
26 }
27
28 SolidColorScrollbarLayer::SolidColorScrollbarLayer(
29 ScrollbarOrientation orientation,
30 int thumb_thickness,
31 int scroll_layer_id)
32 : scroll_layer_id_(scroll_layer_id),
33 orientation_(orientation),
34 thumb_thickness_(thumb_thickness) {}
35
36 SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {}
37
38 ScrollbarLayerInterface* SolidColorScrollbarLayer::ToScrollbarLayer() {
39 return this;
40 }
41
42 bool SolidColorScrollbarLayer::OpacityCanAnimateOnImplThread() const {
43 return true;
44 }
45
46 int SolidColorScrollbarLayer::ScrollLayerId() const {
47 return scroll_layer_id_;
48 }
49
50 void SolidColorScrollbarLayer::SetScrollLayerId(int id) {
51 if (id == scroll_layer_id_)
52 return;
53
54 scroll_layer_id_ = id;
55 SetNeedsFullTreeSync();
56 }
57
58 ScrollbarOrientation SolidColorScrollbarLayer::orientation() const {
59 return orientation_;
60 }
61
62 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/solid_color_scrollbar_layer.h ('k') | cc/layers/solid_color_scrollbar_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698