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 "ui/aura/test/test_window_delegate.h" | 5 #include "ui/aura/test/test_window_delegate.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 #include "ui/base/hit_test.h" | 9 #include "ui/base/hit_test.h" |
| 10 #include "ui/compositor/paint_context.h" |
10 #include "ui/events/event.h" | 11 #include "ui/events/event.h" |
11 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
12 #include "ui/gfx/path.h" | 13 #include "ui/gfx/path.h" |
13 #include "ui/gfx/skia_util.h" | 14 #include "ui/gfx/skia_util.h" |
14 | 15 |
15 #if defined(USE_AURA) | 16 #if defined(USE_AURA) |
16 #include "ui/base/cursor/cursor.h" | 17 #include "ui/base/cursor/cursor.h" |
17 #endif | 18 #endif |
18 | 19 |
19 namespace aura { | 20 namespace aura { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 return true; | 69 return true; |
69 } | 70 } |
70 | 71 |
71 bool TestWindowDelegate::CanFocus() { | 72 bool TestWindowDelegate::CanFocus() { |
72 return can_focus_; | 73 return can_focus_; |
73 } | 74 } |
74 | 75 |
75 void TestWindowDelegate::OnCaptureLost() { | 76 void TestWindowDelegate::OnCaptureLost() { |
76 } | 77 } |
77 | 78 |
78 void TestWindowDelegate::OnPaint(gfx::Canvas* canvas) { | 79 void TestWindowDelegate::OnPaint(const ui::PaintContext& context) { |
79 } | 80 } |
80 | 81 |
81 void TestWindowDelegate::OnDeviceScaleFactorChanged( | 82 void TestWindowDelegate::OnDeviceScaleFactorChanged( |
82 float device_scale_factor) { | 83 float device_scale_factor) { |
83 } | 84 } |
84 | 85 |
85 void TestWindowDelegate::OnWindowDestroying(Window* window) { | 86 void TestWindowDelegate::OnWindowDestroying(Window* window) { |
86 } | 87 } |
87 | 88 |
88 void TestWindowDelegate::OnWindowDestroyed(Window* window) { | 89 void TestWindowDelegate::OnWindowDestroyed(Window* window) { |
(...skipping 24 matching lines...) Expand all Loading... |
113 | 114 |
114 void ColorTestWindowDelegate::OnKeyEvent(ui::KeyEvent* event) { | 115 void ColorTestWindowDelegate::OnKeyEvent(ui::KeyEvent* event) { |
115 last_key_code_ = event->key_code(); | 116 last_key_code_ = event->key_code(); |
116 event->SetHandled(); | 117 event->SetHandled(); |
117 } | 118 } |
118 | 119 |
119 void ColorTestWindowDelegate::OnWindowDestroyed(Window* window) { | 120 void ColorTestWindowDelegate::OnWindowDestroyed(Window* window) { |
120 delete this; | 121 delete this; |
121 } | 122 } |
122 | 123 |
123 void ColorTestWindowDelegate::OnPaint(gfx::Canvas* canvas) { | 124 void ColorTestWindowDelegate::OnPaint(const ui::PaintContext& context) { |
124 canvas->DrawColor(color_, SkXfermode::kSrc_Mode); | 125 context.canvas()->DrawColor(color_, SkXfermode::kSrc_Mode); |
125 } | 126 } |
126 | 127 |
127 //////////////////////////////////////////////////////////////////////////////// | 128 //////////////////////////////////////////////////////////////////////////////// |
128 // MaskedWindowDelegate | 129 // MaskedWindowDelegate |
129 | 130 |
130 MaskedWindowDelegate::MaskedWindowDelegate(const gfx::Rect mask_rect) | 131 MaskedWindowDelegate::MaskedWindowDelegate(const gfx::Rect mask_rect) |
131 : mask_rect_(mask_rect) { | 132 : mask_rect_(mask_rect) { |
132 } | 133 } |
133 | 134 |
134 bool MaskedWindowDelegate::HasHitTestMask() const { | 135 bool MaskedWindowDelegate::HasHitTestMask() const { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } | 223 } |
223 | 224 |
224 int EventCountDelegate::GetGestureCountAndReset() { | 225 int EventCountDelegate::GetGestureCountAndReset() { |
225 int gesture_count = gesture_count_; | 226 int gesture_count = gesture_count_; |
226 gesture_count_ = 0; | 227 gesture_count_ = 0; |
227 return gesture_count; | 228 return gesture_count; |
228 } | 229 } |
229 | 230 |
230 } // namespace test | 231 } // namespace test |
231 } // namespace aura | 232 } // namespace aura |
OLD | NEW |