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" |
(...skipping 24 matching lines...) Expand all Loading... |
35 static_cast<int>(SK_ColorWHITE), | 35 static_cast<int>(SK_ColorWHITE), |
36 static_cast<int>(SK_ColorBLACK) | 36 static_cast<int>(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::Display display = gfx::Screen::GetPrimaryDisplay(); | 45 gfx::Display display = Shell::GetScreen()->GetPrimaryDisplay(); |
46 gfx::Rect bounds = display.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), |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 return ui::ER_UNHANDLED; | 219 return ui::ER_UNHANDLED; |
220 } | 220 } |
221 | 221 |
222 void TouchObserverHUD::OnWidgetClosing(views::Widget* widget) { | 222 void TouchObserverHUD::OnWidgetClosing(views::Widget* widget) { |
223 DCHECK_EQ(widget, widget_); | 223 DCHECK_EQ(widget, widget_); |
224 widget_ = NULL; | 224 widget_ = NULL; |
225 } | 225 } |
226 | 226 |
227 } // namespace internal | 227 } // namespace internal |
228 } // namespace ash | 228 } // namespace ash |
OLD | NEW |