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

Unified Diff: cc/input/inner_viewport_scrollbar.h

Issue 16679011: Add viewport scrollbar class to support overlay scrollbars for pinch zoom virtual viewport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add scrollbars layers in compositor, plumb layer ids to LayerTreeImpl. Created 7 years, 6 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
Index: cc/input/inner_viewport_scrollbar.h
diff --git a/cc/input/inner_viewport_scrollbar.h b/cc/input/inner_viewport_scrollbar.h
new file mode 100644
index 0000000000000000000000000000000000000000..21b8081465e9783f456f47cbee24e5c7295fbadd
--- /dev/null
+++ b/cc/input/inner_viewport_scrollbar.h
@@ -0,0 +1,46 @@
+// 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.
+
+#ifndef CC_INPUT_INNER_VIEWPORT_SCROLLBAR_H_
+#define CC_INPUT_INNER_VIEWPORT_SCROLLBAR_H_
+
+#include "base/memory/ref_counted.h"
+#include "cc/base/cc_export.h"
+#include "cc/input/scrollbar.h"
+#include "ui/gfx/point.h"
+#include "ui/gfx/rect.h"
+
+namespace cc {
+
+class Layer;
+
+class CC_EXPORT InnerViewportScrollbar : public Scrollbar {
+ public:
+ InnerViewportScrollbar(scoped_refptr<Layer> scroll_layer,
+ scoped_refptr<Layer> clip_layer_,
+ ScrollbarOrientation orientation,
+ size_t thickness);
+ virtual ~InnerViewportScrollbar();
+
+ virtual ScrollbarOrientation Orientation() const OVERRIDE;
+ virtual gfx::Point Location() const OVERRIDE;
+ virtual bool IsOverlay() const OVERRIDE;
+ virtual bool HasThumb() const OVERRIDE;
+ virtual int ThumbThickness() const OVERRIDE;
+ virtual int ThumbLength() const OVERRIDE;
+ virtual gfx::Rect TrackRect() const OVERRIDE;
+ virtual void PaintPart(SkCanvas* canvas,
+ ScrollbarPart part,
+ gfx::Rect content_rect) OVERRIDE;
+
+ private:
+ scoped_refptr<Layer> scroll_layer_;
+ scoped_refptr<Layer> clip_layer_;
+ ScrollbarOrientation orientation_;
+ const size_t thickness_;
+};
+
+} // namespace cc
+
+#endif // CC_INPUT_INNER_VIEWPORT_SCROLLBAR_H_

Powered by Google App Engine
This is Rietveld 408576698