| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/util/drag_handle.h" | 5 #include "athena/util/drag_handle.h" |
| 6 | 6 |
| 7 #include "ui/views/background.h" | 7 #include "ui/views/background.h" |
| 8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
| 9 | 9 |
| 10 namespace athena { | 10 namespace athena { |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 const SkColor kDragHandleColorNormal = SK_ColorGRAY; | 13 const SkColor kDragHandleColorNormal = SK_ColorGRAY; |
| 14 const SkColor kDragHandleColorHot = SK_ColorWHITE; | 14 const SkColor kDragHandleColorHot = SK_ColorWHITE; |
| 15 | 15 |
| 16 // This view notifies its delegate of the touch scroll gestures performed on it. | 16 // This view notifies its delegate of the touch scroll gestures performed on it. |
| 17 class DragHandleView : public views::View { | 17 class DragHandleView : public views::View { |
| 18 public: | 18 public: |
| 19 DragHandleView(DragHandleScrollDirection scroll_direction, | 19 DragHandleView(DragHandleScrollDirection scroll_direction, |
| 20 DragHandleScrollDelegate* delegate, | 20 DragHandleScrollDelegate* delegate, |
| 21 int preferred_width, | 21 int preferred_width, |
| 22 int preferred_height); | 22 int preferred_height); |
| 23 virtual ~DragHandleView(); | 23 ~DragHandleView() override; |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 void SetColor(SkColor color); | 26 void SetColor(SkColor color); |
| 27 | 27 |
| 28 void SetIsScrolling(bool scrolling); | 28 void SetIsScrolling(bool scrolling); |
| 29 | 29 |
| 30 // views::View: | 30 // views::View: |
| 31 virtual gfx::Size GetPreferredSize() const override; | 31 virtual gfx::Size GetPreferredSize() const override; |
| 32 virtual void OnGestureEvent(ui::GestureEvent* event) override; | 32 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
| 33 | 33 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 views::View* CreateDragHandleView(DragHandleScrollDirection scroll_direction, | 136 views::View* CreateDragHandleView(DragHandleScrollDirection scroll_direction, |
| 137 DragHandleScrollDelegate* delegate, | 137 DragHandleScrollDelegate* delegate, |
| 138 int preferred_width, | 138 int preferred_width, |
| 139 int preferred_height) { | 139 int preferred_height) { |
| 140 views::View* view = new DragHandleView( | 140 views::View* view = new DragHandleView( |
| 141 scroll_direction, delegate, preferred_width, preferred_height); | 141 scroll_direction, delegate, preferred_width, preferred_height); |
| 142 return view; | 142 return view; |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace athena | 145 } // namespace athena |
| OLD | NEW |