| 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_CLIENT_STACKING_CLIENT_H_ | 5 #ifndef UI_AURA_CLIENT_STACKING_CLIENT_H_ |
| 6 #define UI_AURA_CLIENT_STACKING_CLIENT_H_ | 6 #define UI_AURA_CLIENT_STACKING_CLIENT_H_ |
| 7 | 7 |
| 8 #include "ui/aura/aura_export.h" | 8 #include "ui/aura/aura_export.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| 11 class Rect; | 11 class Rect; |
| 12 } | 12 } |
| 13 | 13 |
| 14 namespace aura { | 14 namespace aura { |
| 15 class Window; | 15 class Window; |
| 16 namespace client { | 16 namespace client { |
| 17 | 17 |
| 18 // An interface implemented by an object that stacks windows. | 18 // An interface implemented by an object that stacks windows. |
| 19 class AURA_EXPORT StackingClient { | 19 class AURA_EXPORT StackingClient { |
| 20 public: | 20 public: |
| 21 virtual ~StackingClient() {} | 21 virtual ~StackingClient() {} |
| 22 | 22 |
| 23 // Called by the Window when its parent is set to NULL, returns the window | 23 // Called by the Window when its parent is set to NULL, returns the window |
| 24 // that |window| should be added to instead. | 24 // that |window| should be added to instead. |context| provides a Window |
| 25 // (generally a RootWindow) that can be used to determine which desktop type |
| 26 // the default parent should be chosen from. |
| 25 // NOTE: this may have side effects. It should only be used when |window| is | 27 // NOTE: this may have side effects. It should only be used when |window| is |
| 26 // going to be immediately added. | 28 // going to be immediately added. |
| 27 virtual Window* GetDefaultParent(Window* window, const gfx::Rect& bounds) = 0; | 29 virtual Window* GetDefaultParent( |
| 30 Window* context, |
| 31 Window* window, |
| 32 const gfx::Rect& bounds) = 0; |
| 28 }; | 33 }; |
| 29 | 34 |
| 30 // Set/Get the default stacking client. | 35 // Set/Get the default stacking client. |
| 31 AURA_EXPORT void SetStackingClient(StackingClient* stacking_client); | 36 AURA_EXPORT void SetStackingClient(StackingClient* stacking_client); |
| 32 AURA_EXPORT StackingClient* GetStackingClient(); | 37 AURA_EXPORT StackingClient* GetStackingClient(); |
| 33 | 38 |
| 34 // Set/Get a stacking client for a specific window. Setting the stacking client | 39 // Set/Get a stacking client for a specific window. Setting the stacking client |
| 35 // sets the stacking client on the window's RootWindow, not the window itself. | 40 // sets the stacking client on the window's RootWindow, not the window itself. |
| 36 // Likewise getting obtains it from the window's RootWindow. If |window| is | 41 // Likewise getting obtains it from the window's RootWindow. If |window| is |
| 37 // non-NULL it must be in a RootWindow. If |window| is NULL, the default | 42 // non-NULL it must be in a RootWindow. If |window| is NULL, the default |
| 38 // stacking client is used. | 43 // stacking client is used. |
| 39 AURA_EXPORT void SetStackingClient(Window* window, | 44 AURA_EXPORT void SetStackingClient(Window* window, |
| 40 StackingClient* stacking_client); | 45 StackingClient* stacking_client); |
| 41 AURA_EXPORT StackingClient* GetStackingClient(Window* window); | 46 AURA_EXPORT StackingClient* GetStackingClient(Window* window); |
| 42 | 47 |
| 48 |
| 43 } // namespace client | 49 } // namespace client |
| 44 } // namespace aura | 50 } // namespace aura |
| 45 | 51 |
| 46 #endif // UI_AURA_CLIENT_STACKING_CLIENT_H_ | 52 #endif // UI_AURA_CLIENT_STACKING_CLIENT_H_ |
| OLD | NEW |