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/touch/touch_observer_hud.h" | 5 #include "ash/touch/touch_observer_hud.h" |
6 | 6 |
7 #include "ash/shell_window_ids.h" | 7 #include "ash/shell_window_ids.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "third_party/skia/include/core/SkPath.h" | 10 #include "third_party/skia/include/core/SkPath.h" |
11 #include "third_party/skia/include/core/SkXfermode.h" | 11 #include "third_party/skia/include/core/SkXfermode.h" |
12 #include "ui/aura/event.h" | 12 #include "ui/aura/event.h" |
13 #include "ui/gfx/canvas.h" | 13 #include "ui/gfx/canvas.h" |
14 #include "ui/gfx/monitor.h" | 14 #include "ui/gfx/display.h" |
15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
17 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
18 #include "ui/views/background.h" | 18 #include "ui/views/background.h" |
19 #include "ui/views/controls/label.h" | 19 #include "ui/views/controls/label.h" |
20 #include "ui/views/layout/box_layout.h" | 20 #include "ui/views/layout/box_layout.h" |
21 #include "ui/views/widget/widget.h" | 21 #include "ui/views/widget/widget.h" |
22 | 22 |
23 namespace ash { | 23 namespace ash { |
24 namespace internal { | 24 namespace internal { |
(...skipping 10 matching lines...) Expand all Loading... |
35 SK_ColorWHITE, | 35 SK_ColorWHITE, |
36 SK_ColorBLACK | 36 SK_ColorBLACK |
37 }; | 37 }; |
38 | 38 |
39 class TouchHudCanvas : public views::View { | 39 class TouchHudCanvas : public views::View { |
40 public: | 40 public: |
41 explicit TouchHudCanvas(TouchObserverHUD* owner) | 41 explicit TouchHudCanvas(TouchObserverHUD* owner) |
42 : owner_(owner), | 42 : owner_(owner), |
43 path_index_(0), | 43 path_index_(0), |
44 color_index_(0) { | 44 color_index_(0) { |
45 gfx::Monitor monitor = gfx::Screen::GetPrimaryMonitor(); | 45 gfx::Display display = gfx::Screen::GetPrimaryMonitor(); |
46 gfx::Rect bounds = monitor.bounds(); | 46 gfx::Rect bounds = display.bounds(); |
47 size_.set_width(bounds.width() / kScale); | 47 size_.set_width(bounds.width() / kScale); |
48 size_.set_height(bounds.height() / kScale); | 48 size_.set_height(bounds.height() / kScale); |
49 } | 49 } |
50 | 50 |
51 virtual ~TouchHudCanvas() {} | 51 virtual ~TouchHudCanvas() {} |
52 | 52 |
53 void Start(int id, const gfx::Point& point) { | 53 void Start(int id, const gfx::Point& point) { |
54 paths_[path_index_].reset(); | 54 paths_[path_index_].reset(); |
55 paths_[path_index_].moveTo(SkIntToScalar(point.x() / kScale), | 55 paths_[path_index_].moveTo(SkIntToScalar(point.x() / kScale), |
56 SkIntToScalar(point.y() / kScale)); | 56 SkIntToScalar(point.y() / kScale)); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 207 } |
208 | 208 |
209 ui::GestureStatus TouchObserverHUD::PreHandleGestureEvent( | 209 ui::GestureStatus TouchObserverHUD::PreHandleGestureEvent( |
210 aura::Window* target, | 210 aura::Window* target, |
211 aura::GestureEvent* event) { | 211 aura::GestureEvent* event) { |
212 return ui::GESTURE_STATUS_UNKNOWN; | 212 return ui::GESTURE_STATUS_UNKNOWN; |
213 } | 213 } |
214 | 214 |
215 } // namespace internal | 215 } // namespace internal |
216 } // namespace ash | 216 } // namespace ash |
OLD | NEW |