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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/solid_color_scrollbar_layer.cc
diff --git a/cc/layers/solid_color_scrollbar_layer.cc b/cc/layers/solid_color_scrollbar_layer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6c71bba767b7f9bf396597ea7f8062916911c299
--- /dev/null
+++ b/cc/layers/solid_color_scrollbar_layer.cc
@@ -0,0 +1,62 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/layers/solid_color_scrollbar_layer.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "cc/layers/layer_impl.h"
+#include "cc/layers/solid_color_scrollbar_layer_impl.h"
+
+namespace cc {
+
+scoped_ptr<LayerImpl> SolidColorScrollbarLayer::CreateLayerImpl(
+ LayerTreeImpl* tree_impl) {
+ return SolidColorScrollbarLayerImpl::Create(
+ tree_impl, id(), orientation(), thumb_thickness_).PassAs<LayerImpl>();
+}
+
+scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create(
+ ScrollbarOrientation orientation,
+ int thumb_thickness,
+ int scroll_layer_id) {
+ return make_scoped_refptr(new SolidColorScrollbarLayer(orientation,
+ thumb_thickness,
+ scroll_layer_id));
+}
+
+SolidColorScrollbarLayer::SolidColorScrollbarLayer(
+ ScrollbarOrientation orientation,
+ int thumb_thickness,
+ int scroll_layer_id)
+ : scroll_layer_id_(scroll_layer_id),
+ orientation_(orientation),
+ thumb_thickness_(thumb_thickness) {}
+
+SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {}
+
+ScrollbarLayerInterface* SolidColorScrollbarLayer::ToScrollbarLayer() {
+ return this;
+}
+
+bool SolidColorScrollbarLayer::OpacityCanAnimateOnImplThread() const {
+ return true;
+}
+
+int SolidColorScrollbarLayer::ScrollLayerId() const {
+ return scroll_layer_id_;
+}
+
+void SolidColorScrollbarLayer::SetScrollLayerId(int id) {
+ if (id == scroll_layer_id_)
+ return;
+
+ scroll_layer_id_ = id;
+ SetNeedsFullTreeSync();
+}
+
+ScrollbarOrientation SolidColorScrollbarLayer::orientation() const {
+ return orientation_;
+}
+
+} // namespace cc
« 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