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/touch_hud_projection.h" | 5 #include "ash/touch/touch_hud_projection.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/wm/property_util.h" | 9 #include "ash/wm/property_util.h" |
10 #include "third_party/skia/include/effects/SkGradientShader.h" | 10 #include "third_party/skia/include/effects/SkGradientShader.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 | 57 |
58 void UpdateTouch(const ui::TouchEvent& touch) { | 58 void UpdateTouch(const ui::TouchEvent& touch) { |
59 if (touch.type() == ui::ET_TOUCH_RELEASED || | 59 if (touch.type() == ui::ET_TOUCH_RELEASED || |
60 touch.type() == ui::ET_TOUCH_CANCELLED) { | 60 touch.type() == ui::ET_TOUCH_CANCELLED) { |
61 fadeout_.reset(new ui::LinearAnimation(kFadeoutDurationInMs, | 61 fadeout_.reset(new ui::LinearAnimation(kFadeoutDurationInMs, |
62 kFadeoutFrameRate, | 62 kFadeoutFrameRate, |
63 this)); | 63 this)); |
64 fadeout_->Start(); | 64 fadeout_->Start(); |
65 } else { | 65 } else { |
66 SetX(touch.root_location().x() - kPointRadius - 1); | 66 SetX(parent()->GetMirroredXInView(touch.root_location().x()) - |
| 67 kPointRadius - 1); |
67 SetY(touch.root_location().y() - kPointRadius - 1); | 68 SetY(touch.root_location().y() - kPointRadius - 1); |
68 } | 69 } |
69 } | 70 } |
70 | 71 |
71 void Remove() { | 72 void Remove() { |
72 delete this; | 73 delete this; |
73 } | 74 } |
74 | 75 |
75 private: | 76 private: |
76 virtual ~TouchPointView() { | 77 virtual ~TouchPointView() { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 controller->set_touch_hud_projection(this); | 178 controller->set_touch_hud_projection(this); |
178 } | 179 } |
179 | 180 |
180 void TouchHudProjection::UnsetHudForRootWindowController( | 181 void TouchHudProjection::UnsetHudForRootWindowController( |
181 RootWindowController* controller) { | 182 RootWindowController* controller) { |
182 controller->set_touch_hud_projection(NULL); | 183 controller->set_touch_hud_projection(NULL); |
183 } | 184 } |
184 | 185 |
185 } // namespace internal | 186 } // namespace internal |
186 } // namespace ash | 187 } // namespace ash |
OLD | NEW |