| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WINDOW_DELEGATE_H_ | 5 #ifndef UI_AURA_WINDOW_DELEGATE_H_ |
| 6 #define UI_AURA_WINDOW_DELEGATE_H_ | 6 #define UI_AURA_WINDOW_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 namespace gfx { | 9 namespace gfx { |
| 10 class Canvas; | 10 class Canvas; |
| 11 class Point; | 11 class Point; |
| 12 class Rect; |
| 12 } | 13 } |
| 13 | 14 |
| 14 namespace aura { | 15 namespace aura { |
| 15 | 16 |
| 16 class KeyEvent; | 17 class KeyEvent; |
| 17 class MouseEvent; | 18 class MouseEvent; |
| 18 | 19 |
| 19 // Delegate interface for aura::Window. | 20 // Delegate interface for aura::Window. |
| 20 class WindowDelegate { | 21 class WindowDelegate { |
| 21 public: | 22 public: |
| 23 // Called when the Window's position and/or size changes. |
| 24 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
| 25 const gfx::Rect& new_bounds) = 0; |
| 26 |
| 22 // Sent to the Window's delegate when the Window gains or loses focus. | 27 // Sent to the Window's delegate when the Window gains or loses focus. |
| 23 virtual void OnFocus() = 0; | 28 virtual void OnFocus() = 0; |
| 24 virtual void OnBlur() = 0; | 29 virtual void OnBlur() = 0; |
| 25 | 30 |
| 26 virtual bool OnKeyEvent(KeyEvent* event) = 0; | 31 virtual bool OnKeyEvent(KeyEvent* event) = 0; |
| 27 | 32 |
| 28 // Returns the non-client component (see hit_test.h) containing |point|, in | 33 // Returns the non-client component (see hit_test.h) containing |point|, in |
| 29 // window coordinates. | 34 // window coordinates. |
| 30 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; | 35 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; |
| 31 | 36 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 44 // The delegate can use this as an opportunity to delete itself if necessary. | 49 // The delegate can use this as an opportunity to delete itself if necessary. |
| 45 virtual void OnWindowDestroyed() = 0; | 50 virtual void OnWindowDestroyed() = 0; |
| 46 | 51 |
| 47 protected: | 52 protected: |
| 48 virtual ~WindowDelegate() {} | 53 virtual ~WindowDelegate() {} |
| 49 }; | 54 }; |
| 50 | 55 |
| 51 } // namespace aura | 56 } // namespace aura |
| 52 | 57 |
| 53 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 58 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
| OLD | NEW |