| 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 "third_party/skia/include/core/SkCanvas.h" | 7 #include "third_party/skia/include/core/SkCanvas.h" |
| 8 #include "ui/aura/event.h" | 8 #include "ui/aura/event.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
| 11 #include "ui/gfx/canvas.h" | 11 #include "ui/gfx/canvas.h" |
| 12 | 12 |
| 13 namespace aura { | 13 namespace aura { |
| 14 namespace test { | 14 namespace test { |
| 15 | 15 |
| 16 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 17 // TestWindowDelegate | 17 // TestWindowDelegate |
| 18 | 18 |
| 19 TestWindowDelegate::TestWindowDelegate() { | 19 TestWindowDelegate::TestWindowDelegate() : window_component_(HTCLIENT) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 TestWindowDelegate::~TestWindowDelegate() { | 22 TestWindowDelegate::~TestWindowDelegate() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 gfx::Size TestWindowDelegate::GetMinimumSize() const { | 25 gfx::Size TestWindowDelegate::GetMinimumSize() const { |
| 26 return gfx::Size(); | 26 return gfx::Size(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void TestWindowDelegate::OnBoundsChanged(const gfx::Rect& old_bounds, | 29 void TestWindowDelegate::OnBoundsChanged(const gfx::Rect& old_bounds, |
| 30 const gfx::Rect& new_bounds) { | 30 const gfx::Rect& new_bounds) { |
| 31 } | 31 } |
| 32 | 32 |
| 33 void TestWindowDelegate::OnFocus() { | 33 void TestWindowDelegate::OnFocus() { |
| 34 } | 34 } |
| 35 | 35 |
| 36 void TestWindowDelegate::OnBlur() { | 36 void TestWindowDelegate::OnBlur() { |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool TestWindowDelegate::OnKeyEvent(KeyEvent* event) { | 39 bool TestWindowDelegate::OnKeyEvent(KeyEvent* event) { |
| 40 return false; | 40 return false; |
| 41 } | 41 } |
| 42 | 42 |
| 43 gfx::NativeCursor TestWindowDelegate::GetCursor(const gfx::Point& point) { | 43 gfx::NativeCursor TestWindowDelegate::GetCursor(const gfx::Point& point) { |
| 44 return gfx::kNullCursor; | 44 return gfx::kNullCursor; |
| 45 } | 45 } |
| 46 | 46 |
| 47 int TestWindowDelegate::GetNonClientComponent(const gfx::Point& point) const { | 47 int TestWindowDelegate::GetNonClientComponent(const gfx::Point& point) const { |
| 48 return HTCLIENT; | 48 return window_component_; |
| 49 } | 49 } |
| 50 | 50 |
| 51 bool TestWindowDelegate::OnMouseEvent(MouseEvent* event) { | 51 bool TestWindowDelegate::OnMouseEvent(MouseEvent* event) { |
| 52 return false; | 52 return false; |
| 53 } | 53 } |
| 54 | 54 |
| 55 ui::TouchStatus TestWindowDelegate::OnTouchEvent(TouchEvent* event) { | 55 ui::TouchStatus TestWindowDelegate::OnTouchEvent(TouchEvent* event) { |
| 56 return ui::TOUCH_STATUS_UNKNOWN; | 56 return ui::TOUCH_STATUS_UNKNOWN; |
| 57 } | 57 } |
| 58 | 58 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 void ColorTestWindowDelegate::OnWindowDestroyed() { | 97 void ColorTestWindowDelegate::OnWindowDestroyed() { |
| 98 delete this; | 98 delete this; |
| 99 } | 99 } |
| 100 void ColorTestWindowDelegate::OnPaint(gfx::Canvas* canvas) { | 100 void ColorTestWindowDelegate::OnPaint(gfx::Canvas* canvas) { |
| 101 canvas->GetSkCanvas()->drawColor(color_, SkXfermode::kSrc_Mode); | 101 canvas->GetSkCanvas()->drawColor(color_, SkXfermode::kSrc_Mode); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace test | 104 } // namespace test |
| 105 } // namespace aura | 105 } // namespace aura |
| OLD | NEW |