Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_WINDOW_PARENTING_CLIENT_H_ | 5 #ifndef UI_AURA_CLIENT_WINDOW_PARENTING_CLIENT_H_ |
| 6 #define UI_AURA_CLIENT_WINDOW_PARENTING_CLIENT_H_ | 6 #define UI_AURA_CLIENT_WINDOW_PARENTING_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 // Implementations of this object are used to help locate a default parent for | 18 // Implementations of this object are used to help locate a default parent for |
| 19 // NULL-parented Windows. | 19 // NULL-parented Windows. |
| 20 class AURA_EXPORT WindowParentingClient { | 20 class AURA_EXPORT WindowParentingClient { |
| 21 public: | 21 public: |
| 22 virtual ~WindowParentingClient() {} | 22 virtual ~WindowParentingClient() {} |
| 23 | 23 |
| 24 // Called by the Window when it looks for a default parent. Returns the | 24 // Called by the Window when it looks for a default parent. Returns the |
| 25 // window that |window| should be added to instead. |context| provides a | 25 // window that |window| should be added to instead. NOTE: this may have |
| 26 // Window (generally a RootWindow) that can be used to determine which | 26 // side effects. It should only be used when |window| is going to be |
| 27 // desktop type the default parent should be chosen from. NOTE: this may | |
| 28 // have side effects. It should only be used when |window| is going to be | |
| 29 // immediately added. | 27 // immediately added. |
| 30 // | 28 // |
| 31 // TODO(erg): Remove |context|, and maybe after oshima's patch lands, | 29 // TODO(erg): Maybe after oshima's patch lands, remove |bounds|. |
|
sky
2017/03/20 17:57:34
Remove this comment as bounds is needed.
| |
| 32 // |bounds|. | 30 virtual Window* GetDefaultParent(Window* window, const gfx::Rect& bounds) = 0; |
| 33 virtual Window* GetDefaultParent(Window* context, | |
| 34 Window* window, | |
| 35 const gfx::Rect& bounds) = 0; | |
| 36 }; | 31 }; |
| 37 | 32 |
| 38 // Set/Get a window tree client for the RootWindow containing |window|. |window| | 33 // Set/Get a window tree client for the RootWindow containing |window|. |window| |
| 39 // must not be NULL. | 34 // must not be NULL. |
| 40 AURA_EXPORT void SetWindowParentingClient( | 35 AURA_EXPORT void SetWindowParentingClient( |
| 41 Window* window, | 36 Window* window, |
| 42 WindowParentingClient* window_tree_client); | 37 WindowParentingClient* window_tree_client); |
| 43 WindowParentingClient* GetWindowParentingClient(Window* window); | 38 WindowParentingClient* GetWindowParentingClient(Window* window); |
| 44 | 39 |
| 45 // Adds |window| to an appropriate parent by consulting an implementation of | 40 // Adds |window| to an appropriate parent by consulting an implementation of |
| 46 // WindowParentingClient attached at the root Window containing |context|. The | 41 // WindowParentingClient attached at the root Window containing |context|. The |
| 47 // final | 42 // final |
| 48 // location may be a window hierarchy other than the one supplied via | 43 // location may be a window hierarchy other than the one supplied via |
| 49 // |context|, which must not be NULL. |screen_bounds| may be empty. | 44 // |context|, which must not be NULL. |screen_bounds| may be empty. |
| 50 AURA_EXPORT void ParentWindowWithContext(Window* window, | 45 AURA_EXPORT void ParentWindowWithContext(Window* window, |
| 51 Window* context, | 46 Window* context, |
| 52 const gfx::Rect& screen_bounds); | 47 const gfx::Rect& screen_bounds); |
| 53 | 48 |
| 54 } // namespace client | 49 } // namespace client |
| 55 } // namespace aura | 50 } // namespace aura |
| 56 | 51 |
| 57 #endif // UI_AURA_CLIENT_WINDOW_PARENTING_CLIENT_H_ | 52 #endif // UI_AURA_CLIENT_WINDOW_PARENTING_CLIENT_H_ |
| OLD | NEW |