Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: ash/wm/common/wm_layout_manager.h

Issue 1894593002: Adds WmLayoutManager and the aura wrapper AuraLayoutManagerAdapter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and feedback Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/aura/aura_layout_manager_adapter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/common/wm_layout_manager.h
diff --git a/ash/wm/common/wm_layout_manager.h b/ash/wm/common/wm_layout_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..d8be091f5a964fe3ddade21eca95c1b301d45f41
--- /dev/null
+++ b/ash/wm/common/wm_layout_manager.h
@@ -0,0 +1,57 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_COMMON_WM_LAYOUT_MANAGER_H_
+#define ASH_WM_COMMON_WM_LAYOUT_MANAGER_H_
+
+#include "ash/ash_export.h"
+
+namespace gfx {
+class Rect;
+}
+
+namespace ash {
+namespace wm {
+
+class WmWindow;
+
+// Used to position the child WmWindows of a WmWindow. WmLayoutManager is called
+// at key points in a WmWindows life cycle thats allow sthe WmLayoutManager to
+// position or change child WmWindows.
+class ASH_EXPORT WmLayoutManager {
+ public:
+ virtual ~WmLayoutManager() {}
+
+ // Invoked when the window the WmLayoutManager is associated with is resized.
+ virtual void OnWindowResized() = 0;
+
+ // Invoked when a window is added to the window the WmLayoutManager is
+ // associated with.
+ virtual void OnWindowAddedToLayout(WmWindow* child) = 0;
+
+ // Invoked prior to removing |child|.
+ virtual void OnWillRemoveWindowFromLayout(WmWindow* child) = 0;
+
+ // Invoked after removing |child|.
+ virtual void OnWindowRemovedFromLayout(WmWindow* child) = 0;
+
+ // Invoked when SetVisible() is invoked on |child|. |visible| is the value
+ // supplied to SetVisible(). If |visible| is true, child->IsVisible() may
+ // still return false. See description in aura::Window::IsVisible() for
+ // details.
+ virtual void OnChildWindowVisibilityChanged(WmWindow* child,
+ bool visibile) = 0;
+
+ // Invoked when WmWindow::SetBounds() is called on |child|. This allows the
+ // WmLayoutManager to modify the bounds as appropriate before processing the
+ // request, including ignoring the request. Implementation must call
+ // SetChildBoundsDirect() so that an infinite loop does not result.
+ virtual void SetChildBounds(WmWindow* child,
+ const gfx::Rect& requested_bounds) = 0;
+};
+
+} // namespace wm
+} // namespace ash
+
+#endif // ASH_WM_COMMON_WM_LAYOUT_MANAGER_H_
« no previous file with comments | « ash/wm/aura/aura_layout_manager_adapter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698