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

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

Issue 2733303004: Removes WmShell::NewWindow() (Closed)
Patch Set: merge and feedback Created 3 years, 9 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/common/shelf/shelf_window_watcher_unittest.cc ('k') | ash/common/wm/window_dimmer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/test/ash_test.cc
diff --git a/ash/common/test/ash_test.cc b/ash/common/test/ash_test.cc
index ba087ec2cf9e4dcf62b382fc230d20fc8895b3c8..5f7550658e7ad114ba3475f1c84425fe9b8e4e14 100644
--- a/ash/common/test/ash_test.cc
+++ b/ash/common/test/ash_test.cc
@@ -14,6 +14,7 @@
#include "ash/root_window_controller.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
+#include "ui/aura/window.h"
#include "ui/compositor/layer_type.h"
#include "ui/display/display.h"
@@ -68,13 +69,14 @@ std::unique_ptr<WindowOwner> AshTest::CreateToplevelTestWindow(
std::unique_ptr<WindowOwner> AshTest::CreateChildWindow(WmWindow* parent,
const gfx::Rect& bounds,
int shell_window_id) {
+ aura::Window* window = new aura::Window(nullptr, ui::wm::WINDOW_TYPE_NORMAL);
+ window->Init(ui::LAYER_NOT_DRAWN);
std::unique_ptr<WindowOwner> window_owner =
- base::MakeUnique<WindowOwner>(WmShell::Get()->NewWindow(
- ui::wm::WINDOW_TYPE_NORMAL, ui::LAYER_NOT_DRAWN));
- window_owner->window()->SetBounds(bounds);
- window_owner->window()->SetShellWindowId(shell_window_id);
- parent->AddChild(window_owner->window());
- window_owner->window()->Show();
+ base::MakeUnique<WindowOwner>(WmWindow::Get(window));
+ window->SetBounds(bounds);
+ window->set_id(shell_window_id);
+ parent->aura_window()->AddChild(window);
+ window->Show();
return window_owner;
}
« no previous file with comments | « ash/common/shelf/shelf_window_watcher_unittest.cc ('k') | ash/common/wm/window_dimmer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698