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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 virtual bool OnMouseEvent(MouseEvent* event) = 0; | 51 virtual bool OnMouseEvent(MouseEvent* event) = 0; |
| 52 | 52 |
| 53 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) = 0; | 53 virtual ui::TouchStatus OnTouchEvent(TouchEvent* event) = 0; |
| 54 | 54 |
| 55 // Returns true if the window should be activated. |event| is either the mouse | 55 // Returns true if the window should be activated. |event| is either the mouse |
| 56 // event supplied if the activation is the result of a mouse, or the touch | 56 // event supplied if the activation is the result of a mouse, or the touch |
| 57 // event if the activation is the result of a touch, or NULL if activation is | 57 // event if the activation is the result of a touch, or NULL if activation is |
| 58 // attempted for another reason. | 58 // attempted for another reason. |
| 59 virtual bool ShouldActivate(Event* event) = 0; | 59 virtual bool ShouldActivate(Event* event) = 0; |
| 60 | 60 |
| 61 // Returns true of the window can be focused. | |
| 62 virtual bool CanFocus() { return true; } | |
|
sadrul
2011/12/01 21:48:03
This probably should be pure virtual?
Ben Goodger (Google)
2011/12/01 22:16:31
Yes it should. In general, when you are adding the
sadrul
2011/12/01 22:18:23
Yes :) I wanted to confirm the approach looks sane
sadrul
2011/12/02 02:25:55
Done.
| |
| 63 | |
| 61 // Sent when the window is activated. | 64 // Sent when the window is activated. |
| 62 virtual void OnActivated() = 0; | 65 virtual void OnActivated() = 0; |
| 63 | 66 |
| 64 // Sent when the window loses active status. | 67 // Sent when the window loses active status. |
| 65 virtual void OnLostActive() = 0; | 68 virtual void OnLostActive() = 0; |
| 66 | 69 |
| 67 // Invoked when mouse capture is lost on the window. | 70 // Invoked when mouse capture is lost on the window. |
| 68 virtual void OnCaptureLost() = 0; | 71 virtual void OnCaptureLost() = 0; |
| 69 | 72 |
| 70 // Asks the delegate to paint window contents into the supplied canvas. | 73 // Asks the delegate to paint window contents into the supplied canvas. |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 83 // Called when the visibility of a Window changed. | 86 // Called when the visibility of a Window changed. |
| 84 virtual void OnWindowVisibilityChanged(bool visible) = 0; | 87 virtual void OnWindowVisibilityChanged(bool visible) = 0; |
| 85 | 88 |
| 86 protected: | 89 protected: |
| 87 virtual ~WindowDelegate() {} | 90 virtual ~WindowDelegate() {} |
| 88 }; | 91 }; |
| 89 | 92 |
| 90 } // namespace aura | 93 } // namespace aura |
| 91 | 94 |
| 92 #endif // UI_AURA_WINDOW_DELEGATE_H_ | 95 #endif // UI_AURA_WINDOW_DELEGATE_H_ |
| OLD | NEW |