15e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 25e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)// found in the LICENSE file. 45e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 55e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)#ifndef UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ 65e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)#define UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ 75e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 8d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "ui/gfx/animation/slide_animation.h" 95e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)#include "ui/views/controls/scrollbar/base_scroll_bar.h" 105e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 115e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)namespace views { 125e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 135e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)// The transparent scrollbar which overlays its contents. 145e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)class VIEWS_EXPORT OverlayScrollBar : public BaseScrollBar { 155e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) public: 165e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) explicit OverlayScrollBar(bool horizontal); 175e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) virtual ~OverlayScrollBar(); 185e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 195e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) protected: 205e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) // BaseScrollBar overrides: 215e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) virtual gfx::Rect GetTrackBounds() const OVERRIDE; 22eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 235e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 245e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) // ScrollBar overrides: 255e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) virtual int GetLayoutSize() const OVERRIDE; 265e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) virtual int GetContentOverlapSize() const OVERRIDE; 275e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) virtual void OnMouseEnteredScrollView(const ui::MouseEvent& event) OVERRIDE; 285e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) virtual void OnMouseExitedScrollView(const ui::MouseEvent& event) OVERRIDE; 295e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 305e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) // View overrides: 31cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) virtual gfx::Size GetPreferredSize() const OVERRIDE; 325e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) virtual void Layout() OVERRIDE; 335e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 345e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 355e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) private: 36d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles) gfx::SlideAnimation animation_; 375e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(OverlayScrollBar); 385e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)}; 395e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 405e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)} // namespace views 415e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles) 425e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)#endif // UI_VIEWS_CONTROLS_SCROLLBAR_OVERLAY_SCROLL_BAR_H_ 43