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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) = 0; | 45 virtual gfx::NativeCursor GetCursor(const gfx::Point& point) = 0; |
46 | 46 |
47 // Returns the non-client component (see hit_test.h) containing |point|, in | 47 // Returns the non-client component (see hit_test.h) containing |point|, in |
48 // window coordinates. | 48 // window coordinates. |
49 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; | 49 virtual int GetNonClientComponent(const gfx::Point& point) const = 0; |
50 | 50 |
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 of the window can be focused. |
| 56 virtual bool CanFocus() = 0; |
| 57 |
55 // Returns true if the window should be activated. |event| is either the mouse | 58 // 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 | 59 // 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 | 60 // event if the activation is the result of a touch, or NULL if activation is |
58 // attempted for another reason. | 61 // attempted for another reason. |
59 virtual bool ShouldActivate(Event* event) = 0; | 62 virtual bool ShouldActivate(Event* event) = 0; |
60 | 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. |
(...skipping 18 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 |