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

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

Issue 863223002: Add missing views class names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: table Created 5 years, 11 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
« no previous file with comments | « ui/views/controls/slider.h ('k') | ui/views/controls/styled_label.h » ('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 #include "ui/views/controls/slider.h" 5 #include "ui/views/controls/slider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 enum BorderElements { 44 enum BorderElements {
45 LEFT, 45 LEFT,
46 CENTER_LEFT, 46 CENTER_LEFT,
47 CENTER_RIGHT, 47 CENTER_RIGHT,
48 RIGHT, 48 RIGHT,
49 }; 49 };
50 } // namespace 50 } // namespace
51 51
52 namespace views { 52 namespace views {
53 53
54 // static
55 const char Slider::kViewClassName[] = "Slider";
56
54 Slider::Slider(SliderListener* listener, Orientation orientation) 57 Slider::Slider(SliderListener* listener, Orientation orientation)
55 : listener_(listener), 58 : listener_(listener),
56 orientation_(orientation), 59 orientation_(orientation),
57 value_(0.f), 60 value_(0.f),
58 keyboard_increment_(0.1f), 61 keyboard_increment_(0.1f),
59 animating_value_(0.f), 62 animating_value_(0.f),
60 value_is_valid_(false), 63 value_is_valid_(false),
61 accessibility_events_enabled_(true), 64 accessibility_events_enabled_(true),
62 focus_border_color_(0), 65 focus_border_color_(0),
63 bar_active_images_(kBarImagesActive), 66 bar_active_images_(kBarImagesActive),
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 182
180 if (!focus_border_color_) { 183 if (!focus_border_color_) {
181 canvas->DrawFocusRect(GetLocalBounds()); 184 canvas->DrawFocusRect(GetLocalBounds());
182 } else if (HasFocus()) { 185 } else if (HasFocus()) {
183 canvas->DrawSolidFocusRect( 186 canvas->DrawSolidFocusRect(
184 gfx::Rect(1, 1, width() - 3, height() - 3), 187 gfx::Rect(1, 1, width() - 3, height() - 3),
185 focus_border_color_); 188 focus_border_color_);
186 } 189 }
187 } 190 }
188 191
192 const char* Slider::GetClassName() const {
193 return kViewClassName;
194 }
195
189 gfx::Size Slider::GetPreferredSize() const { 196 gfx::Size Slider::GetPreferredSize() const {
190 const int kSizeMajor = 200; 197 const int kSizeMajor = 200;
191 const int kSizeMinor = 40; 198 const int kSizeMinor = 40;
192 199
193 if (orientation_ == HORIZONTAL) 200 if (orientation_ == HORIZONTAL)
194 return gfx::Size(std::max(width(), kSizeMajor), kSizeMinor); 201 return gfx::Size(std::max(width(), kSizeMajor), kSizeMinor);
195 return gfx::Size(kSizeMinor, std::max(height(), kSizeMajor)); 202 return gfx::Size(kSizeMinor, std::max(height(), kSizeMajor));
196 } 203 }
197 204
198 void Slider::OnPaint(gfx::Canvas* canvas) { 205 void Slider::OnPaint(gfx::Canvas* canvas) {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 if (listener_) 362 if (listener_)
356 listener_->SliderDragStarted(this); 363 listener_->SliderDragStarted(this);
357 } 364 }
358 365
359 void Slider::OnSliderDragEnded() { 366 void Slider::OnSliderDragEnded() {
360 if (listener_) 367 if (listener_)
361 listener_->SliderDragEnded(this); 368 listener_->SliderDragEnded(this);
362 } 369 }
363 370
364 } // namespace views 371 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/slider.h ('k') | ui/views/controls/styled_label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698