| OLD | NEW |
| 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 "ash/wm/gestures/long_press_affordance_handler.h" | 5 #include "ash/wm/gestures/long_press_affordance_handler.h" |
| 6 | 6 |
| 7 #include <memory> |
| 8 |
| 7 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
| 11 #include "third_party/skia/include/core/SkPaint.h" | 13 #include "third_party/skia/include/core/SkPaint.h" |
| 12 #include "third_party/skia/include/core/SkPath.h" | 14 #include "third_party/skia/include/core/SkPath.h" |
| 13 #include "third_party/skia/include/core/SkRect.h" | 15 #include "third_party/skia/include/core/SkRect.h" |
| 14 #include "third_party/skia/include/effects/SkGradientShader.h" | 16 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 15 #include "ui/aura/client/screen_position_client.h" | 17 #include "ui/aura/client/screen_position_client.h" |
| 16 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // Paint inner circle. | 208 // Paint inner circle. |
| 207 PaintAffordanceArc(canvas, center, kAffordanceInnerRadius, | 209 PaintAffordanceArc(canvas, center, kAffordanceInnerRadius, |
| 208 kAffordanceInnerStartAngle, -current_angle_); | 210 kAffordanceInnerStartAngle, -current_angle_); |
| 209 // Paint outer circle. | 211 // Paint outer circle. |
| 210 PaintAffordanceArc(canvas, center, kAffordanceOuterRadius, | 212 PaintAffordanceArc(canvas, center, kAffordanceOuterRadius, |
| 211 kAffordanceOuterStartAngle, current_angle_); | 213 kAffordanceOuterStartAngle, current_angle_); |
| 212 | 214 |
| 213 canvas->Restore(); | 215 canvas->Restore(); |
| 214 } | 216 } |
| 215 | 217 |
| 216 scoped_ptr<views::Widget> widget_; | 218 std::unique_ptr<views::Widget> widget_; |
| 217 int current_angle_; | 219 int current_angle_; |
| 218 double current_scale_; | 220 double current_scale_; |
| 219 | 221 |
| 220 DISALLOW_COPY_AND_ASSIGN(LongPressAffordanceView); | 222 DISALLOW_COPY_AND_ASSIGN(LongPressAffordanceView); |
| 221 }; | 223 }; |
| 222 | 224 |
| 223 //////////////////////////////////////////////////////////////////////////////// | 225 //////////////////////////////////////////////////////////////////////////////// |
| 224 // LongPressAffordanceHandler, public | 226 // LongPressAffordanceHandler, public |
| 225 | 227 |
| 226 LongPressAffordanceHandler::LongPressAffordanceHandler() | 228 LongPressAffordanceHandler::LongPressAffordanceHandler() |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 break; | 350 break; |
| 349 } | 351 } |
| 350 } | 352 } |
| 351 | 353 |
| 352 void LongPressAffordanceHandler::OnWindowDestroying(aura::Window* window) { | 354 void LongPressAffordanceHandler::OnWindowDestroying(aura::Window* window) { |
| 353 DCHECK_EQ(tap_down_target_, window); | 355 DCHECK_EQ(tap_down_target_, window); |
| 354 StopAffordance(); | 356 StopAffordance(); |
| 355 } | 357 } |
| 356 | 358 |
| 357 } // namespace ash | 359 } // namespace ash |
| OLD | NEW |