Chromium Code Reviews| 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_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 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 // Delegate interface for aura::Window. | 33 // Delegate interface for aura::Window. |
| 34 class AURA_EXPORT WindowDelegate : public ui::EventHandler { | 34 class AURA_EXPORT WindowDelegate : public ui::EventHandler { |
| 35 public: | 35 public: |
| 36 // Returns the window's minimum size, or size 0,0 if there is no limit. | 36 // Returns the window's minimum size, or size 0,0 if there is no limit. |
| 37 virtual gfx::Size GetMinimumSize() const = 0; | 37 virtual gfx::Size GetMinimumSize() const = 0; |
| 38 | 38 |
| 39 // Returns the window's maximum size, or size 0,0 if there is no limit. | 39 // Returns the window's maximum size, or size 0,0 if there is no limit. |
| 40 virtual gfx::Size GetMaximumSize() const = 0; | 40 virtual gfx::Size GetMaximumSize() const = 0; |
| 41 | 41 |
| 42 // Ensure the host window is at least this large so that transitions have | |
| 43 // sufficient space. | |
| 44 virtual void SetHostTransitionBounds(const gfx::Rect& bounds) = 0; | |
|
sky
2013/03/15 03:15:05
This and OnWindowHidingAnimationCompleted seem so
scottmg
2013/03/15 22:23:46
Done, seems much better.
| |
| 45 | |
| 42 // Called when the Window's position and/or size changes. | 46 // Called when the Window's position and/or size changes. |
| 43 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, | 47 virtual void OnBoundsChanged(const gfx::Rect& old_bounds, |
| 44 const gfx::Rect& new_bounds) = 0; | 48 const gfx::Rect& new_bounds) = 0; |
| 45 | 49 |
| 46 // Returns the native cursor for the specified point, in window coordinates, | 50 // Returns the native cursor for the specified point, in window coordinates, |
| 47 // or NULL for the default cursor. | 51 // or NULL for the default cursor. |
| 48 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) = 0; | 52 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) = 0; |
| 49 | 53 |
| 50 // Returns the non-client component (see hit_test.h) containing |point|, in | 54 // Returns the non-client component (see hit_test.h) containing |point|, in |
| 51 // window coordinates. | 55 // window coordinates. |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 62 | 66 |
| 63 // Invoked when mouse capture is lost on the window. | 67 // Invoked when mouse capture is lost on the window. |
| 64 virtual void OnCaptureLost() = 0; | 68 virtual void OnCaptureLost() = 0; |
| 65 | 69 |
| 66 // Asks the delegate to paint window contents into the supplied canvas. | 70 // Asks the delegate to paint window contents into the supplied canvas. |
| 67 virtual void OnPaint(gfx::Canvas* canvas) = 0; | 71 virtual void OnPaint(gfx::Canvas* canvas) = 0; |
| 68 | 72 |
| 69 // Called when the window's device scale factor has changed. | 73 // Called when the window's device scale factor has changed. |
| 70 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; | 74 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; |
| 71 | 75 |
| 76 // Called after the window has faded out on a hide. | |
| 77 virtual void OnWindowHidingAnimationCompleted() = 0; | |
| 78 | |
| 72 // Called from Window's destructor before OnWindowDestroyed and before the | 79 // Called from Window's destructor before OnWindowDestroyed and before the |
| 73 // children have been destroyed and the window has been removed from its | 80 // children have been destroyed and the window has been removed from its |
| 74 // parent. | 81 // parent. |
| 75 virtual void OnWindowDestroying() = 0; | 82 virtual void OnWindowDestroying() = 0; |
| 76 | 83 |
| 77 // Called when the Window has been destroyed (i.e. from its destructor). This | 84 // Called when the Window has been destroyed (i.e. from its destructor). This |
| 78 // is called after OnWindowDestroying and after the children have been | 85 // is called after OnWindowDestroying and after the children have been |
| 79 // deleted and the window has been removed from its parent. | 86 // deleted and the window has been removed from its parent. |
| 80 // The delegate can use this as an opportunity to delete itself if necessary. | 87 // The delegate can use this as an opportunity to delete itself if necessary. |
| 81 virtual void OnWindowDestroyed() = 0; | 88 virtual void OnWindowDestroyed() = 0; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 99 // an external texture. | 106 // an external texture. |
| 100 virtual scoped_refptr<ui::Texture> CopyTexture() = 0; | 107 virtual scoped_refptr<ui::Texture> CopyTexture() = 0; |
| 101 | 108 |
| 102 protected: | 109 protected: |
| 103 virtual ~WindowDelegate() {} | 110 virtual ~WindowDelegate() {} |
| 104 }; | 111 }; |
| 105 | 112 |
| 106 } // namespace aura | 113 } // namespace aura |
| 107 | 114 |
| 108 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 115 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
| OLD | NEW |