Chromium Code Reviews| 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 #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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 virtual bool OnMouseEvent(MouseEvent* event) = 0; | 47 virtual bool OnMouseEvent(MouseEvent* event) = 0; |
| 48 | 48 |
| 49 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) = 0; | 49 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) = 0; |
| 50 | 50 |
| 51 // Returns true if the window should be activated. |event| is either the mouse | 51 // Returns true if the window should be activated. |event| is either the mouse |
| 52 // event supplied if the activation is the result of a mouse, or the touch | 52 // event supplied if the activation is the result of a mouse, or the touch |
| 53 // event if the activation is the result of a touch, or NULL if activation is | 53 // event if the activation is the result of a touch, or NULL if activation is |
| 54 // attempted for another reason. | 54 // attempted for another reason. |
| 55 virtual bool ShouldActivate(Event* event) = 0; | 55 virtual bool ShouldActivate(Event* event) = 0; |
| 56 | 56 |
| 57 // Returns true if this window should accept events, false if it should | |
| 58 // ignore all events and make them pass to the window behind it. | |
| 59 virtual bool ShouldAcceptEvents() { return true; } | |
|
Ben Goodger (Google)
2011/11/15 22:10:53
Everything else on this interface is pure virtual.
| |
| 60 | |
| 57 // Sent when the window is activated. | 61 // Sent when the window is activated. |
| 58 virtual void OnActivated() = 0; | 62 virtual void OnActivated() = 0; |
| 59 | 63 |
| 60 // Sent when the window loses active status. | 64 // Sent when the window loses active status. |
| 61 virtual void OnLostActive() = 0; | 65 virtual void OnLostActive() = 0; |
| 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. |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 79 // Called when the visibility of a Window changed. | 83 // Called when the visibility of a Window changed. |
| 80 virtual void OnWindowVisibilityChanged(bool visible) = 0; | 84 virtual void OnWindowVisibilityChanged(bool visible) = 0; |
| 81 | 85 |
| 82 protected: | 86 protected: |
| 83 virtual ~WindowDelegate() {} | 87 virtual ~WindowDelegate() {} |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 } // namespace aura | 90 } // namespace aura |
| 87 | 91 |
| 88 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 92 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
| OLD | NEW |