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_BASE_BASE_WINDOW_H_ | 5 #ifndef UI_BASE_BASE_WINDOW_H_ |
6 #define UI_BASE_BASE_WINDOW_H_ | 6 #define UI_BASE_BASE_WINDOW_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/base/ui_base_types.h" // WindowShowState | 9 #include "ui/base/ui_base_types.h" // WindowShowState |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Returns the restore state for the window (platform dependent). | 47 // Returns the restore state for the window (platform dependent). |
48 virtual ui::WindowShowState GetRestoredState() const = 0; | 48 virtual ui::WindowShowState GetRestoredState() const = 0; |
49 | 49 |
50 // Retrieves the window's current bounds, including its window. | 50 // Retrieves the window's current bounds, including its window. |
51 // This will only differ from GetRestoredBounds() for maximized | 51 // This will only differ from GetRestoredBounds() for maximized |
52 // and minimized windows. | 52 // and minimized windows. |
53 virtual gfx::Rect GetBounds() const = 0; | 53 virtual gfx::Rect GetBounds() const = 0; |
54 | 54 |
55 // Shows the window, or activates it if it's already visible. | 55 // Shows the window, or activates it if it's already visible. |
56 virtual void Show() = 0; | 56 virtual void Show() = 0; |
| 57 // Like Show(), but some window managers will give this higher priority. |
| 58 virtual void ShowForUserGesture(); |
57 | 59 |
58 // Hides the window. | 60 // Hides the window. |
59 virtual void Hide() = 0; | 61 virtual void Hide() = 0; |
60 | 62 |
61 // Show the window, but do not activate it. Does nothing if window | 63 // Show the window, but do not activate it. Does nothing if window |
62 // is already visible. | 64 // is already visible. |
63 virtual void ShowInactive() = 0; | 65 virtual void ShowInactive() = 0; |
64 | 66 |
65 // Closes the window as soon as possible. The close action may be delayed | 67 // Closes the window as soon as possible. The close action may be delayed |
66 // if an operation is in progress (e.g. a drag operation). | 68 // if an operation is in progress (e.g. a drag operation). |
67 virtual void Close() = 0; | 69 virtual void Close() = 0; |
68 | 70 |
69 // Activates (brings to front) the window. Restores the window from minimized | 71 // Activates (brings to front) the window. Restores the window from minimized |
70 // state if necessary. | 72 // state if necessary. |
71 virtual void Activate() = 0; | 73 virtual void Activate() = 0; |
| 74 // Like Activate(), but some window managers will give this higher priority. |
| 75 virtual void ActivateForUserGesture(); |
72 | 76 |
73 // Deactivates the window, making the next window in the Z order the active | 77 // Deactivates the window, making the next window in the Z order the active |
74 // window. | 78 // window. |
75 virtual void Deactivate() = 0; | 79 virtual void Deactivate() = 0; |
76 | 80 |
77 // Maximizes/minimizes/restores the window. | 81 // Maximizes/minimizes/restores the window. |
78 virtual void Maximize() = 0; | 82 virtual void Maximize() = 0; |
79 virtual void Minimize() = 0; | 83 virtual void Minimize() = 0; |
80 virtual void Restore() = 0; | 84 virtual void Restore() = 0; |
81 | 85 |
82 // Sets the window's size and position to the specified values. | 86 // Sets the window's size and position to the specified values. |
83 virtual void SetBounds(const gfx::Rect& bounds) = 0; | 87 virtual void SetBounds(const gfx::Rect& bounds) = 0; |
84 | 88 |
85 // Flashes the taskbar item associated with this window. | 89 // Flashes the taskbar item associated with this window. |
86 // Set |flash| to true to initiate flashing, false to stop flashing. | 90 // Set |flash| to true to initiate flashing, false to stop flashing. |
87 virtual void FlashFrame(bool flash) = 0; | 91 virtual void FlashFrame(bool flash) = 0; |
88 | 92 |
89 // Returns true if a window is set to be always on top. | 93 // Returns true if a window is set to be always on top. |
90 virtual bool IsAlwaysOnTop() const = 0; | 94 virtual bool IsAlwaysOnTop() const = 0; |
91 | 95 |
92 // If set to true, the window will stay on top of other windows which do not | 96 // If set to true, the window will stay on top of other windows which do not |
93 // have this flag enabled. | 97 // have this flag enabled. |
94 virtual void SetAlwaysOnTop(bool always_on_top) = 0; | 98 virtual void SetAlwaysOnTop(bool always_on_top) = 0; |
95 }; | 99 }; |
96 | 100 |
97 } // namespace ui | 101 } // namespace ui |
98 | 102 |
99 #endif // UI_BASE_BASE_WINDOW_H_ | 103 #endif // UI_BASE_BASE_WINDOW_H_ |
OLD | NEW |