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

Unified Diff: ash/wm/window_util.cc

Issue 12442009: Minor Ash panel related cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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/window_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_util.cc
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index 6f591a4b7b2fd0d57560caed993a7e414c8212f7..45a2add17770f24f28d8d0fd4b4a3708cda497e2 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -22,6 +22,8 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/screen.h"
#include "ui/views/corewm/window_util.h"
+#include "ui/views/view.h"
+#include "ui/views/widget/widget.h"
namespace ash {
namespace wm {
@@ -201,5 +203,19 @@ void AdjustBoundsToEnsureWindowVisibility(const gfx::Rect& work_area,
}
}
+void MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) {
+ views::View* target = static_cast<views::View*>(event.target());
+ if (!target)
+ return;
+ aura::RootWindow* target_root =
+ target->GetWidget()->GetNativeView()->GetRootWindow();
+ if (!target_root || target_root == window->GetRootWindow())
+ return;
+ aura::Window* window_container =
+ ash::Shell::GetContainer(target_root, window->parent()->id());
+ // Move the window to the target launcher.
+ window_container->AddChild(window);
+}
+
} // namespace wm
} // namespace ash
« no previous file with comments | « ash/wm/window_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698