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

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

Issue 9853019: Modify the pure-views slider to reset on ESC. (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') | ui/views/controls/slider.cc » ('J')
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 void SetAccessibleName(const string16& name); 51 void SetAccessibleName(const string16& name);
52 52
53 private: 53 private:
54 void SetValueInternal(float value, SliderChangeReason reason); 54 void SetValueInternal(float value, SliderChangeReason reason);
55 55
56 // views::View overrides: 56 // views::View overrides:
57 virtual gfx::Size GetPreferredSize() OVERRIDE; 57 virtual gfx::Size GetPreferredSize() OVERRIDE;
58 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 58 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
59 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; 59 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
60 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
60 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; 61 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE;
61 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 62 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
63 virtual bool AcceleratorPressed(const ui::Accelerator&) OVERRIDE;
62 64
63 // ui::AnimationDelegate overrides: 65 // ui::AnimationDelegate overrides:
64 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; 66 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
65 67
66 SliderListener* listener_; 68 SliderListener* listener_;
67 Orientation orientation_; 69 Orientation orientation_;
68 70
69 scoped_ptr<ui::SlideAnimation> move_animation_; 71 scoped_ptr<ui::SlideAnimation> move_animation_;
70 72
71 float value_; 73 float value_;
72 float animating_value_; 74 float animating_value_;
75 float original_value_;
73 bool value_is_valid_; 76 bool value_is_valid_;
74 string16 accessible_name_; 77 string16 accessible_name_;
78 bool esc_was_pressed_;
75 79
76 DISALLOW_COPY_AND_ASSIGN(Slider); 80 DISALLOW_COPY_AND_ASSIGN(Slider);
77 }; 81 };
78 82
79 } // namespace views 83 } // namespace views
80 84
81 #endif // UI_VIEWS_CONTROLS_SLIDER_H_ 85 #endif // UI_VIEWS_CONTROLS_SLIDER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/slider.cc » ('j') | ui/views/controls/slider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698