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

Side by Side Diff: ui/views/controls/slider.h

Issue 10089001: views slider: Add support for gestures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « no previous file | ui/views/controls/slider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_CONTROLS_SLIDER_H_ 5 #ifndef UI_VIEWS_CONTROLS_SLIDER_H_
6 #define UI_VIEWS_CONTROLS_SLIDER_H_ 6 #define UI_VIEWS_CONTROLS_SLIDER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ui/base/animation/animation_delegate.h" 9 #include "ui/base/animation/animation_delegate.h"
10 #include "ui/views/view.h" 10 #include "ui/views/view.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void SetValue(float value); 54 void SetValue(float value);
55 55
56 // Set the delta used for changing the value via keyboard. 56 // Set the delta used for changing the value via keyboard.
57 void SetKeyboardIncrement(float increment); 57 void SetKeyboardIncrement(float increment);
58 58
59 void SetAccessibleName(const string16& name); 59 void SetAccessibleName(const string16& name);
60 60
61 private: 61 private:
62 void SetValueInternal(float value, SliderChangeReason reason); 62 void SetValueInternal(float value, SliderChangeReason reason);
63 63
64 // Moves the button to the specified point and updates the value accordingly.
65 void MoveButtonTo(const gfx::Point& point);
66
64 // views::View overrides: 67 // views::View overrides:
65 virtual gfx::Size GetPreferredSize() OVERRIDE; 68 virtual gfx::Size GetPreferredSize() OVERRIDE;
66 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 69 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
67 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; 70 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
68 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; 71 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE;
69 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; 72 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
73 virtual ui::GestureStatus OnGestureEvent(
74 const views::GestureEvent& event) OVERRIDE;
70 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; 75 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
71 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 76 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
72 77
73 // ui::AnimationDelegate overrides: 78 // ui::AnimationDelegate overrides:
74 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; 79 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
75 80
76 SliderListener* listener_; 81 SliderListener* listener_;
77 Orientation orientation_; 82 Orientation orientation_;
78 83
79 scoped_ptr<ui::SlideAnimation> move_animation_; 84 scoped_ptr<ui::SlideAnimation> move_animation_;
80 85
81 float value_; 86 float value_;
82 float keyboard_increment_; 87 float keyboard_increment_;
83 float animating_value_; 88 float animating_value_;
84 bool value_is_valid_; 89 bool value_is_valid_;
85 string16 accessible_name_; 90 string16 accessible_name_;
86 91
87 DISALLOW_COPY_AND_ASSIGN(Slider); 92 DISALLOW_COPY_AND_ASSIGN(Slider);
88 }; 93 };
89 94
90 } // namespace views 95 } // namespace views
91 96
92 #endif // UI_VIEWS_CONTROLS_SLIDER_H_ 97 #endif // UI_VIEWS_CONTROLS_SLIDER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/slider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698