| 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; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 virtual void OnBlur() = 0; | 29 virtual void OnBlur() = 0; |
| 30 | 30 |
| 31 virtual bool OnKeyEvent(KeyEvent* event) = 0; | 31 virtual bool OnKeyEvent(KeyEvent* event) = 0; |
| 32 | 32 |
| 33 // 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 |
| 34 // window coordinates. | 34 // window coordinates. |
| 35 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; | 35 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; |
| 36 | 36 |
| 37 virtual bool OnMouseEvent(MouseEvent* event) = 0; | 37 virtual bool OnMouseEvent(MouseEvent* event) = 0; |
| 38 | 38 |
| 39 // Invoked when mouse capture is lost on the window. |
| 40 virtual void OnCaptureLost() = 0; |
| 41 |
| 39 // Asks the delegate to paint window contents into the supplied canvas. | 42 // Asks the delegate to paint window contents into the supplied canvas. |
| 40 virtual void OnPaint(gfx::Canvas* canvas) = 0; | 43 virtual void OnPaint(gfx::Canvas* canvas) = 0; |
| 41 | 44 |
| 42 // Called from Window's destructor before OnWindowDestroyed and before the | 45 // Called from Window's destructor before OnWindowDestroyed and before the |
| 43 // children have been destroyed. | 46 // children have been destroyed. |
| 44 virtual void OnWindowDestroying() = 0; | 47 virtual void OnWindowDestroying() = 0; |
| 45 | 48 |
| 46 // Called when the Window has been destroyed (i.e. from its destructor). This | 49 // Called when the Window has been destroyed (i.e. from its destructor). This |
| 47 // is called after OnWindowDestroying and after the children have been | 50 // is called after OnWindowDestroying and after the children have been |
| 48 // deleted. | 51 // deleted. |
| 49 // The delegate can use this as an opportunity to delete itself if necessary. | 52 // The delegate can use this as an opportunity to delete itself if necessary. |
| 50 virtual void OnWindowDestroyed() = 0; | 53 virtual void OnWindowDestroyed() = 0; |
| 51 | 54 |
| 52 protected: | 55 protected: |
| 53 virtual ~WindowDelegate() {} | 56 virtual ~WindowDelegate() {} |
| 54 }; | 57 }; |
| 55 | 58 |
| 56 } // namespace aura | 59 } // namespace aura |
| 57 | 60 |
| 58 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 61 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
| OLD | NEW |