Make castv2 performance test work.
[chromium-blink-merge.git] / ui / views / controls / resize_area.h
blobe3900a4f87c363a34f7728547b4d7179f70fd7d2
1 // Copyright (c) 2011 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.
5 #ifndef UI_VIEWS_CONTROLS_RESIZE_AREA_H_
6 #define UI_VIEWS_CONTROLS_RESIZE_AREA_H_
8 #include <string>
10 #include "ui/views/view.h"
12 namespace views {
14 class ResizeAreaDelegate;
16 ////////////////////////////////////////////////////////////////////////////////
18 // An invisible area that acts like a horizontal resizer.
20 ////////////////////////////////////////////////////////////////////////////////
21 class VIEWS_EXPORT ResizeArea : public View {
22 public:
23 static const char kViewClassName[];
25 explicit ResizeArea(ResizeAreaDelegate* delegate);
26 ~ResizeArea() override;
28 // Overridden from views::View:
29 const char* GetClassName() const override;
30 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
31 bool OnMousePressed(const ui::MouseEvent& event) override;
32 bool OnMouseDragged(const ui::MouseEvent& event) override;
33 void OnMouseReleased(const ui::MouseEvent& event) override;
34 void OnMouseCaptureLost() override;
35 void GetAccessibleState(ui::AXViewState* state) override;
37 private:
38 // Report the amount the user resized by to the delegate, accounting for
39 // directionality.
40 void ReportResizeAmount(int resize_amount, bool last_update);
42 // The delegate to notify when we have updates.
43 ResizeAreaDelegate* delegate_;
45 // The mouse position at start (in screen coordinates).
46 int initial_position_;
48 DISALLOW_COPY_AND_ASSIGN(ResizeArea);
51 } // namespace views
53 #endif // UI_VIEWS_CONTROLS_RESIZE_AREA_H_