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

Side by Side Diff: ui/views/controls/scrollbar/overlay_scroll_bar.cc

Issue 677563004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/scrollbar/overlay_scroll_bar.h" 5 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h"
6 6
7 #include "third_party/skia/include/core/SkColor.h" 7 #include "third_party/skia/include/core/SkColor.h"
8 #include "third_party/skia/include/core/SkXfermode.h" 8 #include "third_party/skia/include/core/SkXfermode.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/background.h" 10 #include "ui/views/background.h"
11 #include "ui/views/border.h" 11 #include "ui/views/border.h"
12 #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" 12 #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h"
13 13
14 namespace views { 14 namespace views {
15 namespace { 15 namespace {
16 16
17 const int kScrollbarWidth = 10; 17 const int kScrollbarWidth = 10;
18 const int kThumbInsetInside = 3; 18 const int kThumbInsetInside = 3;
19 const int kThumbInsetFromEdge = 1; 19 const int kThumbInsetFromEdge = 1;
20 const int kThumbCornerRadius = 2; 20 const int kThumbCornerRadius = 2;
21 const int kThumbMinimumSize = kScrollbarWidth; 21 const int kThumbMinimumSize = kScrollbarWidth;
22 const int kThumbHoverAlpha = 128; 22 const int kThumbHoverAlpha = 128;
23 const int kThumbDefaultAlpha = 64; 23 const int kThumbDefaultAlpha = 64;
24 24
25 class OverlayScrollBarThumb : public BaseScrollBarThumb, 25 class OverlayScrollBarThumb : public BaseScrollBarThumb,
26 public gfx::AnimationDelegate { 26 public gfx::AnimationDelegate {
27 public: 27 public:
28 explicit OverlayScrollBarThumb(BaseScrollBar* scroll_bar); 28 explicit OverlayScrollBarThumb(BaseScrollBar* scroll_bar);
29 virtual ~OverlayScrollBarThumb(); 29 ~OverlayScrollBarThumb() override;
30 30
31 protected: 31 protected:
32 // View overrides: 32 // View overrides:
33 virtual gfx::Size GetPreferredSize() const override; 33 gfx::Size GetPreferredSize() const override;
34 virtual void OnPaint(gfx::Canvas* canvas) override; 34 void OnPaint(gfx::Canvas* canvas) override;
35 35
36 // gfx::AnimationDelegate overrides: 36 // gfx::AnimationDelegate overrides:
37 virtual void AnimationProgressed(const gfx::Animation* animation) override; 37 void AnimationProgressed(const gfx::Animation* animation) override;
38 38
39 private: 39 private:
40 double animation_opacity_; 40 double animation_opacity_;
41 DISALLOW_COPY_AND_ASSIGN(OverlayScrollBarThumb); 41 DISALLOW_COPY_AND_ASSIGN(OverlayScrollBarThumb);
42 }; 42 };
43 43
44 OverlayScrollBarThumb::OverlayScrollBarThumb(BaseScrollBar* scroll_bar) 44 OverlayScrollBarThumb::OverlayScrollBarThumb(BaseScrollBar* scroll_bar)
45 : BaseScrollBarThumb(scroll_bar), 45 : BaseScrollBarThumb(scroll_bar),
46 animation_opacity_(0.0) { 46 animation_opacity_(0.0) {
47 // This is necessary, otherwise the thumb will be rendered below the views if 47 // This is necessary, otherwise the thumb will be rendered below the views if
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 thumb_bounds.set_y(thumb->y()); 152 thumb_bounds.set_y(thumb->y());
153 thumb_bounds.set_height(thumb->height()); 153 thumb_bounds.set_height(thumb->height());
154 } 154 }
155 thumb->SetBoundsRect(thumb_bounds); 155 thumb->SetBoundsRect(thumb_bounds);
156 } 156 }
157 157
158 void OverlayScrollBar::OnPaint(gfx::Canvas* canvas) { 158 void OverlayScrollBar::OnPaint(gfx::Canvas* canvas) {
159 } 159 }
160 160
161 } // namespace views 161 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/overlay_scroll_bar.h ('k') | ui/views/controls/scrollbar/scroll_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698