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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/aura/aura_export.h" | 9 #include "ui/aura/aura_export.h" |
10 #include "ui/base/events.h" | 10 #include "ui/base/events.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // Returns true of the window can be focused. | 58 // Returns true of the window can be focused. |
59 virtual bool CanFocus() = 0; | 59 virtual bool CanFocus() = 0; |
60 | 60 |
61 // Invoked when mouse capture is lost on the window. | 61 // Invoked when mouse capture is lost on the window. |
62 virtual void OnCaptureLost() = 0; | 62 virtual void OnCaptureLost() = 0; |
63 | 63 |
64 // Asks the delegate to paint window contents into the supplied canvas. | 64 // Asks the delegate to paint window contents into the supplied canvas. |
65 virtual void OnPaint(gfx::Canvas* canvas) = 0; | 65 virtual void OnPaint(gfx::Canvas* canvas) = 0; |
66 | 66 |
| 67 // Called when the window's device scale factor has changed. |
| 68 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; |
| 69 |
67 // Called from Window's destructor before OnWindowDestroyed and before the | 70 // Called from Window's destructor before OnWindowDestroyed and before the |
68 // children have been destroyed and the window has been removed from its | 71 // children have been destroyed and the window has been removed from its |
69 // parent. | 72 // parent. |
70 virtual void OnWindowDestroying() = 0; | 73 virtual void OnWindowDestroying() = 0; |
71 | 74 |
72 // Called when the Window has been destroyed (i.e. from its destructor). This | 75 // Called when the Window has been destroyed (i.e. from its destructor). This |
73 // is called after OnWindowDestroying and after the children have been | 76 // is called after OnWindowDestroying and after the children have been |
74 // deleted and the window has been removed from its parent. | 77 // deleted and the window has been removed from its parent. |
75 // The delegate can use this as an opportunity to delete itself if necessary. | 78 // The delegate can use this as an opportunity to delete itself if necessary. |
76 virtual void OnWindowDestroyed() = 0; | 79 virtual void OnWindowDestroyed() = 0; |
77 | 80 |
78 // Called when the visibility of a Window changes. See description in | 81 // Called when the visibility of a Window changes. See description in |
79 // WindowObserver::OnWindowDestroyed() for details. | 82 // WindowObserver::OnWindowDestroyed() for details. |
80 // TODO: this should be renamed to OnWindowTargetVisibilityChanged() to | 83 // TODO: this should be renamed to OnWindowTargetVisibilityChanged() to |
81 // match when it's sent. | 84 // match when it's sent. |
82 virtual void OnWindowVisibilityChanged(bool visible) = 0; | 85 virtual void OnWindowVisibilityChanged(bool visible) = 0; |
83 | 86 |
84 protected: | 87 protected: |
85 virtual ~WindowDelegate() {} | 88 virtual ~WindowDelegate() {} |
86 }; | 89 }; |
87 | 90 |
88 } // namespace aura | 91 } // namespace aura |
89 | 92 |
90 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 93 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
OLD | NEW |