| 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 #ifndef UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ | 5 #ifndef UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ |
| 6 #define UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ | 6 #define UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 virtual void OnFocus() OVERRIDE; | 30 virtual void OnFocus() OVERRIDE; |
| 31 virtual void OnBlur() OVERRIDE; | 31 virtual void OnBlur() OVERRIDE; |
| 32 virtual bool OnKeyEvent(KeyEvent* event) OVERRIDE; | 32 virtual bool OnKeyEvent(KeyEvent* event) OVERRIDE; |
| 33 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE; | 33 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE; |
| 34 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; | 34 virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE; |
| 35 virtual bool OnMouseEvent(MouseEvent* event) OVERRIDE; | 35 virtual bool OnMouseEvent(MouseEvent* event) OVERRIDE; |
| 36 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) OVERRIDE; | 36 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) OVERRIDE; |
| 37 virtual ui::GestureStatus OnGestureEvent(GestureEvent* event) OVERRIDE; | 37 virtual ui::GestureStatus OnGestureEvent(GestureEvent* event) OVERRIDE; |
| 38 virtual bool CanFocus() OVERRIDE; | 38 virtual bool CanFocus() OVERRIDE; |
| 39 virtual void OnCaptureLost() OVERRIDE; | 39 virtual void OnCaptureLost() OVERRIDE; |
| 40 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 40 virtual void OnPaint(gfx::CanvasSkia* canvas) OVERRIDE; |
| 41 virtual void OnWindowDestroying() OVERRIDE; | 41 virtual void OnWindowDestroying() OVERRIDE; |
| 42 virtual void OnWindowDestroyed() OVERRIDE; | 42 virtual void OnWindowDestroyed() OVERRIDE; |
| 43 virtual void OnWindowVisibilityChanged(bool visible) OVERRIDE; | 43 virtual void OnWindowVisibilityChanged(bool visible) OVERRIDE; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 int window_component_; | 46 int window_component_; |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); | 48 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // A simple WindowDelegate implementation for these tests. It owns itself | 51 // A simple WindowDelegate implementation for these tests. It owns itself |
| 52 // (deletes itself when the Window it is attached to is destroyed). | 52 // (deletes itself when the Window it is attached to is destroyed). |
| 53 class ColorTestWindowDelegate : public TestWindowDelegate { | 53 class ColorTestWindowDelegate : public TestWindowDelegate { |
| 54 public: | 54 public: |
| 55 explicit ColorTestWindowDelegate(SkColor color); | 55 explicit ColorTestWindowDelegate(SkColor color); |
| 56 virtual ~ColorTestWindowDelegate(); | 56 virtual ~ColorTestWindowDelegate(); |
| 57 | 57 |
| 58 ui::KeyboardCode last_key_code() const { return last_key_code_; } | 58 ui::KeyboardCode last_key_code() const { return last_key_code_; } |
| 59 | 59 |
| 60 // Overridden from TestWindowDelegate: | 60 // Overridden from TestWindowDelegate: |
| 61 virtual bool OnKeyEvent(KeyEvent* event) OVERRIDE; | 61 virtual bool OnKeyEvent(KeyEvent* event) OVERRIDE; |
| 62 virtual void OnWindowDestroyed() OVERRIDE; | 62 virtual void OnWindowDestroyed() OVERRIDE; |
| 63 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 63 virtual void OnPaint(gfx::CanvasSkia* canvas) OVERRIDE; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 SkColor color_; | 66 SkColor color_; |
| 67 ui::KeyboardCode last_key_code_; | 67 ui::KeyboardCode last_key_code_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(ColorTestWindowDelegate); | 69 DISALLOW_COPY_AND_ASSIGN(ColorTestWindowDelegate); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace test | 72 } // namespace test |
| 73 } // namespace aura | 73 } // namespace aura |
| 74 | 74 |
| 75 #endif // UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ | 75 #endif // UI_AURA_TEST_TEST_WINDOW_DELEGATE_H_ |
| OLD | NEW |