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

Unified Diff: ash/common/test/test_shelf_item_delegate.cc

Issue 2480713003: Window prerequisites for ShelfWindowWatcher panel support. (Closed)
Patch Set: Support and test pre-widget exo ShellSurface::SetApplicationId. Created 4 years, 1 month 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/aura/wm_window_aura.cc ('k') | ash/common/wm_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/test/test_shelf_item_delegate.cc
diff --git a/ash/common/test/test_shelf_item_delegate.cc b/ash/common/test/test_shelf_item_delegate.cc
index 96916d677e071fa598307e4d01be04f208a63b09..6983a1edf91e1fa92041498d1ca2f63817fe9b7f 100644
--- a/ash/common/test/test_shelf_item_delegate.cc
+++ b/ash/common/test/test_shelf_item_delegate.cc
@@ -4,34 +4,11 @@
#include "ash/common/test/test_shelf_item_delegate.h"
-#include "ash/common/wm_lookup.h"
#include "ash/common/wm_window.h"
-#include "ui/events/event.h"
-#include "ui/views/view.h"
-#include "ui/views/widget/widget.h"
namespace ash {
namespace test {
-namespace {
-
-// Moves |window| to the root window where the |event| occurred.
-// Note: This was forked from ash/wm/window_util.h's wm::MoveWindowToEventRoot.
-void MoveWindowToEventRoot(WmWindow* window, const ui::Event& event) {
- views::View* target = static_cast<views::View*>(event.target());
- if (!target)
- return;
- WmWindow* target_root =
- WmLookup::Get()->GetWindowForWidget(target->GetWidget())->GetRootWindow();
- if (!target_root || target_root == window->GetRootWindow())
- return;
- WmWindow* window_container = target_root->GetChildByShellWindowId(
- window->GetParent()->GetShellWindowId());
- window_container->AddChild(window);
-}
-
-} // namespace
-
TestShelfItemDelegate::TestShelfItemDelegate(WmWindow* window)
: window_(window), is_draggable_(true) {}
@@ -41,7 +18,7 @@ ShelfItemDelegate::PerformedAction TestShelfItemDelegate::ItemSelected(
const ui::Event& event) {
if (window_) {
if (window_->GetType() == ui::wm::WINDOW_TYPE_PANEL)
- MoveWindowToEventRoot(window_, event);
+ window_->MoveToEventRoot(event);
window_->Show();
window_->Activate();
return kExistingWindowActivated;
« no previous file with comments | « ash/aura/wm_window_aura.cc ('k') | ash/common/wm_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698