OLD | NEW |
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 "ash/touch_hud/touch_hud_renderer.h" | 5 #include "ash/touch_hud/touch_hud_renderer.h" |
6 | 6 |
7 #include "third_party/skia/include/effects/SkGradientShader.h" | 7 #include "third_party/skia/include/effects/SkGradientShader.h" |
8 #include "ui/compositor/layer.h" | 8 #include "ui/compositor/layer.h" |
9 #include "ui/compositor/layer_owner.h" | 9 #include "ui/compositor/layer_owner.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // TouchPointView draws a single touch point. This object manages its own | 28 // TouchPointView draws a single touch point. This object manages its own |
29 // lifetime and deletes itself upon fade-out completion or whenever |Destroy()| | 29 // lifetime and deletes itself upon fade-out completion or whenever |Destroy()| |
30 // is explicitly called. | 30 // is explicitly called. |
31 class TouchPointView : public views::View, | 31 class TouchPointView : public views::View, |
32 public gfx::AnimationDelegate, | 32 public gfx::AnimationDelegate, |
33 public views::WidgetObserver { | 33 public views::WidgetObserver { |
34 public: | 34 public: |
35 explicit TouchPointView(views::Widget* parent_widget) | 35 explicit TouchPointView(views::Widget* parent_widget) |
36 : circle_center_(kPointRadius + 1, kPointRadius + 1), | 36 : circle_center_(kPointRadius + 1, kPointRadius + 1), |
37 gradient_center_(SkPoint::Make(kPointRadius + 1, kPointRadius + 1)) { | 37 gradient_center_(SkPoint::Make(kPointRadius + 1, kPointRadius + 1)) { |
38 SetPaintToLayer(true); | 38 SetPaintToLayer(); |
39 layer()->SetFillsBoundsOpaquely(false); | 39 layer()->SetFillsBoundsOpaquely(false); |
40 | 40 |
41 SetSize(gfx::Size(2 * kPointRadius + 2, 2 * kPointRadius + 2)); | 41 SetSize(gfx::Size(2 * kPointRadius + 2, 2 * kPointRadius + 2)); |
42 | 42 |
43 stroke_paint_.setStyle(SkPaint::kStroke_Style); | 43 stroke_paint_.setStyle(SkPaint::kStroke_Style); |
44 stroke_paint_.setColor(kProjectionStrokeColor); | 44 stroke_paint_.setColor(kProjectionStrokeColor); |
45 | 45 |
46 gradient_colors_[0] = kProjectionFillColor; | 46 gradient_colors_[0] = kProjectionFillColor; |
47 gradient_colors_[1] = kProjectionStrokeColor; | 47 gradient_colors_[1] = kProjectionStrokeColor; |
48 | 48 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 if (event.type() == ui::ET_TOUCH_RELEASED || | 171 if (event.type() == ui::ET_TOUCH_RELEASED || |
172 event.type() == ui::ET_TOUCH_CANCELLED || | 172 event.type() == ui::ET_TOUCH_CANCELLED || |
173 event.type() == ui::ET_POINTER_UP || | 173 event.type() == ui::ET_POINTER_UP || |
174 event.type() == ui::ET_POINTER_CANCELLED) | 174 event.type() == ui::ET_POINTER_CANCELLED) |
175 points_.erase(iter); | 175 points_.erase(iter); |
176 } | 176 } |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 } // namespace ash | 180 } // namespace ash |
OLD | NEW |