diff options
Diffstat (limited to 'ash')
24 files changed, 68 insertions, 62 deletions
diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc index b416d38..60528ec 100644 --- a/ash/display/screen_position_controller.cc +++ b/ash/display/screen_position_controller.cc @@ -14,7 +14,6 @@ #include "ui/aura/client/activation_client.h" #include "ui/aura/client/capture_client.h" #include "ui/aura/client/focus_client.h" -#include "ui/aura/client/stacking_client.h" #include "ui/aura/root_window.h" #include "ui/aura/window_tracker.h" #include "ui/compositor/dip_util.h" diff --git a/ash/display/screen_position_controller_unittest.cc b/ash/display/screen_position_controller_unittest.cc index 680ee83..2cd6133 100644 --- a/ash/display/screen_position_controller_unittest.cc +++ b/ash/display/screen_position_controller_unittest.cc @@ -56,7 +56,7 @@ class ScreenPositionControllerTest : public test::AshTestBase { window_.reset(new aura::Window(&window_delegate_)); window_->SetType(aura::client::WINDOW_TYPE_NORMAL); window_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(window_.get()); + ParentWindowInPrimaryRootWindow(window_.get()); window_->set_id(1); } diff --git a/ash/drag_drop/drag_drop_tracker.cc b/ash/drag_drop/drag_drop_tracker.cc index 4fd1de8..f18e0e8 100644 --- a/ash/drag_drop/drag_drop_tracker.cc +++ b/ash/drag_drop/drag_drop_tracker.cc @@ -7,6 +7,7 @@ #include "ash/shell.h" #include "ash/shell_window_ids.h" #include "ash/wm/coordinate_conversion.h" +#include "ui/aura/client/window_tree_client.h" #include "ui/aura/root_window.h" #include "ui/events/event.h" #include "ui/gfx/screen.h" @@ -22,7 +23,7 @@ aura::Window* CreateCaptureWindow(aura::RootWindow* context_root, aura::Window* window = new aura::Window(delegate); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_NOT_DRAWN); - window->SetDefaultParentByRootWindow(context_root, gfx::Rect()); + aura::client::ParentWindowWithContext(window, context_root, gfx::Rect()); window->Show(); DCHECK(window->bounds().size().IsEmpty()); return window; diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 946e1e3..0349ab8 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc @@ -565,7 +565,7 @@ RootWindowController::RootWindowController(aura::RootWindow* root_window) screen_dimmer_.reset(new ScreenDimmer(root_window)); stacking_controller_.reset(new StackingController); - aura::client::SetStackingClient(root_window, stacking_controller_.get()); + aura::client::SetWindowTreeClient(root_window, stacking_controller_.get()); capture_client_.reset(new views::corewm::ScopedCaptureClient(root_window)); } diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc index 70d9146..1de918c 100644 --- a/ash/root_window_controller_unittest.cc +++ b/ash/root_window_controller_unittest.cc @@ -17,6 +17,7 @@ #include "base/command_line.h" #include "ui/aura/client/focus_change_observer.h" #include "ui/aura/client/focus_client.h" +#include "ui/aura/client/window_tree_client.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/test/event_generator.h" @@ -573,8 +574,8 @@ TEST_F(RootWindowControllerTest, DontDeleteWindowsNotOwnedByParent) { window1->set_owned_by_parent(false); observer1.SetWindow(window1); window1->Init(ui::LAYER_NOT_DRAWN); - window1->SetDefaultParentByRootWindow( - Shell::GetInstance()->GetPrimaryRootWindow(), gfx::Rect()); + aura::client::ParentWindowWithContext( + window1, Shell::GetInstance()->GetPrimaryRootWindow(), gfx::Rect()); DestroyedWindowObserver observer2; aura::Window* window2 = new aura::Window(NULL); diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 93dfc57..9795e0e 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc @@ -347,7 +347,7 @@ class ShelfLayoutManagerTest : public ash::test::AshTestBase { window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); - SetDefaultParentByPrimaryRootWindow(window); + ParentWindowInPrimaryRootWindow(window); return window; } diff --git a/ash/shell/content_client/shell_browser_main_parts.cc b/ash/shell/content_client/shell_browser_main_parts.cc index 46575ae..f8eb434 100644 --- a/ash/shell/content_client/shell_browser_main_parts.cc +++ b/ash/shell/content_client/shell_browser_main_parts.cc @@ -21,7 +21,6 @@ #include "content/shell/browser/shell_browser_context.h" #include "content/shell/browser/shell_net_log.h" #include "net/base/net_module.h" -#include "ui/aura/client/stacking_client.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc index 79c64f9b..994f456 100644 --- a/ash/shell_unittest.cc +++ b/ash/shell_unittest.cc @@ -477,7 +477,7 @@ TEST_F(ShellTest, ToggleAutoHide) { window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); - SetDefaultParentByPrimaryRootWindow(window.get()); + ParentWindowInPrimaryRootWindow(window.get()); window->Show(); wm::ActivateWindow(window.get()); diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index dcbc747..b6c10a4 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -20,6 +20,7 @@ #include "content/public/test/web_contents_tester.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/screen_position_client.h" +#include "ui/aura/client/window_tree_client.h" #include "ui/aura/root_window.h" #include "ui/aura/test/event_generator.h" #include "ui/aura/test/test_window_delegate.h" @@ -249,7 +250,7 @@ aura::Window* AshTestBase::CreateTestWindowInShellWithDelegateAndType( window->Show(); if (bounds.IsEmpty()) { - SetDefaultParentByPrimaryRootWindow(window); + ParentWindowInPrimaryRootWindow(window); } else { gfx::Display display = Shell::GetScreen()->GetDisplayMatching(bounds); @@ -258,15 +259,15 @@ aura::Window* AshTestBase::CreateTestWindowInShellWithDelegateAndType( gfx::Point origin = bounds.origin(); wm::ConvertPointFromScreen(root, &origin); window->SetBounds(gfx::Rect(origin, bounds.size())); - window->SetDefaultParentByRootWindow(root, bounds); + aura::client::ParentWindowWithContext(window, root, bounds); } window->SetProperty(aura::client::kCanMaximizeKey, true); return window; } -void AshTestBase::SetDefaultParentByPrimaryRootWindow(aura::Window* window) { - window->SetDefaultParentByRootWindow( - Shell::GetPrimaryRootWindow(), gfx::Rect()); +void AshTestBase::ParentWindowInPrimaryRootWindow(aura::Window* window) { + aura::client::ParentWindowWithContext( + window, Shell::GetPrimaryRootWindow(), gfx::Rect()); } void AshTestBase::RunAllPendingInMessageLoop() { diff --git a/ash/test/ash_test_base.h b/ash/test/ash_test_base.h index 281073e..dc2bfe4 100644 --- a/ash/test/ash_test_base.h +++ b/ash/test/ash_test_base.h @@ -87,7 +87,7 @@ class AshTestBase : public testing::Test { const gfx::Rect& bounds); // Attach |window| to the current shell's root window. - void SetDefaultParentByPrimaryRootWindow(aura::Window* window); + void ParentWindowInPrimaryRootWindow(aura::Window* window); // Returns the EventGenerator that uses screen coordinates and works // across multiple displays. It createse a new generator if it diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc index e30a94b..f5f5028 100644 --- a/ash/wm/dock/docked_window_layout_manager.cc +++ b/ash/wm/dock/docked_window_layout_manager.cc @@ -23,6 +23,7 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/aura/client/activation_client.h" #include "ui/aura/client/focus_client.h" +#include "ui/aura/client/window_tree_client.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" @@ -111,7 +112,7 @@ void UndockWindow(aura::Window* window) { window->layer()->GetAnimator()->StopAnimating(); gfx::Rect previous_bounds = window->bounds(); aura::Window* previous_parent = window->parent(); - window->SetDefaultParentByRootWindow(window->GetRootWindow(), gfx::Rect()); + aura::client::ParentWindowWithContext(window, window, gfx::Rect()); if (window->parent() != previous_parent) wm::ReparentTransientChildrenOfChild(window->parent(), window); // Animate maximize animation from previous window bounds. diff --git a/ash/wm/dock/docked_window_resizer.cc b/ash/wm/dock/docked_window_resizer.cc index 218391a..f900818 100644 --- a/ash/wm/dock/docked_window_resizer.cc +++ b/ash/wm/dock/docked_window_resizer.cc @@ -22,6 +22,7 @@ #include "base/command_line.h" #include "base/memory/weak_ptr.h" #include "ui/aura/client/aura_constants.h" +#include "ui/aura/client/window_tree_client.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" @@ -270,7 +271,7 @@ void DockedWindowResizer::FinishedDragging() { wm::ReparentChildWithTransientChildren(dock_container, window); } else if (window->parent()->id() == kShellWindowId_DockedContainer) { // Reparent the window back to workspace. - // We need to be careful to give SetDefaultParentByRootWindow location in + // We need to be careful to give ParentWindowWithContext a location in // the right root window (matching the logic in DragWindowResizer) based // on which root window a mouse pointer is in. We want to undock into the // right screen near the edge of a multiscreen setup (based on where the @@ -278,8 +279,7 @@ void DockedWindowResizer::FinishedDragging() { gfx::Rect near_last_location(last_location_, gfx::Size()); // Reparenting will cause Relayout and possible dock shrinking. aura::Window* previous_parent = window->parent(); - window->SetDefaultParentByRootWindow(window->GetRootWindow(), - near_last_location); + aura::client::ParentWindowWithContext(window, window, near_last_location); if (window->parent() != previous_parent) wm::ReparentTransientChildrenOfChild(window->parent(), window); } diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc index a17f9b5..5be8a78 100644 --- a/ash/wm/drag_window_resizer_unittest.cc +++ b/ash/wm/drag_window_resizer_unittest.cc @@ -48,14 +48,14 @@ class DragWindowResizerTest : public test::AshTestBase { window_.reset(new aura::Window(&delegate_)); window_->SetType(aura::client::WINDOW_TYPE_NORMAL); window_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(window_.get()); + ParentWindowInPrimaryRootWindow(window_.get()); window_->set_id(1); always_on_top_window_.reset(new aura::Window(&delegate2_)); always_on_top_window_->SetType(aura::client::WINDOW_TYPE_NORMAL); always_on_top_window_->SetProperty(aura::client::kAlwaysOnTopKey, true); always_on_top_window_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(always_on_top_window_.get()); + ParentWindowInPrimaryRootWindow(always_on_top_window_.get()); always_on_top_window_->set_id(2); system_modal_window_.reset(new aura::Window(&delegate3_)); @@ -63,26 +63,26 @@ class DragWindowResizerTest : public test::AshTestBase { system_modal_window_->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_SYSTEM); system_modal_window_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(system_modal_window_.get()); + ParentWindowInPrimaryRootWindow(system_modal_window_.get()); system_modal_window_->set_id(3); transient_child_ = new aura::Window(&delegate4_); transient_child_->SetType(aura::client::WINDOW_TYPE_NORMAL); transient_child_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(transient_child_); + ParentWindowInPrimaryRootWindow(transient_child_); transient_child_->set_id(4); transient_parent_.reset(new aura::Window(&delegate5_)); transient_parent_->SetType(aura::client::WINDOW_TYPE_NORMAL); transient_parent_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(transient_parent_.get()); + ParentWindowInPrimaryRootWindow(transient_parent_.get()); transient_parent_->AddTransientChild(transient_child_); transient_parent_->set_id(5); panel_window_.reset(new aura::Window(&delegate6_)); panel_window_->SetType(aura::client::WINDOW_TYPE_PANEL); panel_window_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(panel_window_.get()); + ParentWindowInPrimaryRootWindow(panel_window_.get()); } virtual void TearDown() OVERRIDE { @@ -227,7 +227,7 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplaysActiveRoot) { scoped_ptr<aura::Window> window(new aura::Window(&delegate)); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); - SetDefaultParentByPrimaryRootWindow(window.get()); + ParentWindowInPrimaryRootWindow(window.get()); window->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), Shell::GetScreen()->GetPrimaryDisplay()); window->Show(); diff --git a/ash/wm/header_painter_unittest.cc b/ash/wm/header_painter_unittest.cc index 4691911..a6e8515 100644 --- a/ash/wm/header_painter_unittest.cc +++ b/ash/wm/header_painter_unittest.cc @@ -17,6 +17,7 @@ #include "grit/ash_resources.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/client/aura_constants.h" +#include "ui/aura/client/window_tree_client.h" #include "ui/aura/root_window.h" #include "ui/aura/window_observer.h" #include "ui/base/hit_test.h" @@ -395,8 +396,8 @@ TEST_F(HeaderPainterTest, UseSoloWindowHeaderNotDrawn) { scoped_ptr<aura::Window> window(new aura::Window(NULL)); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_NOT_DRAWN); - window->SetDefaultParentByRootWindow( - widget->GetNativeWindow()->GetRootWindow(), gfx::Rect()); + aura::client::ParentWindowWithContext(window.get(), widget->GetNativeWindow(), + gfx::Rect()); window->Show(); // Despite two windows, the first window should still be considered "solo" diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc index c646679..56d8e5a 100644 --- a/ash/wm/panels/panel_layout_manager.cc +++ b/ash/wm/panels/panel_layout_manager.cc @@ -25,6 +25,7 @@ #include "third_party/skia/include/core/SkPath.h" #include "ui/aura/client/activation_client.h" #include "ui/aura/client/focus_client.h" +#include "ui/aura/client/window_tree_client.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/compositor/scoped_layer_animation_settings.h" @@ -352,9 +353,8 @@ void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) { // back to appropriate container and ignore it. // TODO(varkha): Updating bounds during a drag can cause problems and a more // general solution is needed. See http://crbug.com/251813 . - child->SetDefaultParentByRootWindow( - child->GetRootWindow(), - child->GetRootWindow()->GetBoundsInScreen()); + aura::client::ParentWindowWithContext( + child, child, child->GetRootWindow()->GetBoundsInScreen()); wm::ReparentTransientChildrenOfChild(child->parent(), child); DCHECK(child->parent()->id() != kShellWindowId_PanelContainer); return; diff --git a/ash/wm/panels/panel_window_resizer.cc b/ash/wm/panels/panel_window_resizer.cc index 03a69f0..49b356c 100644 --- a/ash/wm/panels/panel_window_resizer.cc +++ b/ash/wm/panels/panel_window_resizer.cc @@ -17,6 +17,7 @@ #include "ash/wm/window_util.h" #include "base/memory/weak_ptr.h" #include "ui/aura/client/aura_constants.h" +#include "ui/aura/client/window_tree_client.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" @@ -195,10 +196,11 @@ void PanelWindowResizer::StartedDragging() { wm::GetWindowState(GetTarget())->set_panel_attached(true); // We use root window coordinates to ensure that during the drag the panel // is reparented to a container in the root window that has that window. - GetTarget()->SetDefaultParentByRootWindow( - GetTarget()->GetRootWindow(), - GetTarget()->GetRootWindow()->GetBoundsInScreen()); - wm::ReparentTransientChildrenOfChild(GetTarget()->parent(), GetTarget()); + aura::Window* target = GetTarget(); + aura::RootWindow* target_root = target->GetRootWindow(); + aura::client::ParentWindowWithContext( + target, target_root, target_root->GetBoundsInScreen()); + wm::ReparentTransientChildrenOfChild(target->parent(), target); } } @@ -209,10 +211,11 @@ void PanelWindowResizer::FinishDragging() { wm::GetWindowState(GetTarget())->set_panel_attached(should_attach_); // We use last known location to ensure that after the drag the panel // is reparented to a container in the root window that has that location. - GetTarget()->SetDefaultParentByRootWindow( - GetTarget()->GetRootWindow(), - gfx::Rect(last_location_, gfx::Size())); - wm::ReparentTransientChildrenOfChild(GetTarget()->parent(), GetTarget()); + aura::Window* target = GetTarget(); + aura::RootWindow* target_root = target->GetRootWindow(); + aura::client::ParentWindowWithContext( + target, target_root, gfx::Rect(last_location_, gfx::Size())); + wm::ReparentTransientChildrenOfChild(target->parent(), GetTarget()); } // If we started the drag in one root window and moved into another root diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc index 0d23d69..7b211a3 100644 --- a/ash/wm/stacking_controller.cc +++ b/ash/wm/stacking_controller.cc @@ -67,7 +67,7 @@ StackingController::~StackingController() { } //////////////////////////////////////////////////////////////////////////////// -// StackingController, aura::StackingClient implementation: +// StackingController, aura::client::WindowTreeClient implementation: aura::Window* StackingController::GetDefaultParent(aura::Window* context, aura::Window* window, diff --git a/ash/wm/stacking_controller.h b/ash/wm/stacking_controller.h index 07003cb..0aa690e 100644 --- a/ash/wm/stacking_controller.h +++ b/ash/wm/stacking_controller.h @@ -9,7 +9,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "ui/aura/client/stacking_client.h" +#include "ui/aura/client/window_tree_client.h" namespace aura{ class RootWindow; @@ -21,12 +21,12 @@ namespace internal { class AlwaysOnTopController; } -class ASH_EXPORT StackingController : public aura::client::StackingClient { +class ASH_EXPORT StackingController : public aura::client::WindowTreeClient { public: StackingController(); virtual ~StackingController(); - // Overridden from aura::client::StackingClient: + // Overridden from aura::client::WindowTreeClient: virtual aura::Window* GetDefaultParent(aura::Window* context, aura::Window* window, const gfx::Rect& bounds) OVERRIDE; diff --git a/ash/wm/stacking_controller_unittest.cc b/ash/wm/stacking_controller_unittest.cc index b7b1f1b..e0ccaa1 100644 --- a/ash/wm/stacking_controller_unittest.cc +++ b/ash/wm/stacking_controller_unittest.cc @@ -50,7 +50,7 @@ TEST_F(StackingControllerTest, TransientParent) { scoped_ptr<Window> w1(CreateTestWindow()); w2->AddTransientChild(w1.get()); w1->SetBounds(gfx::Rect(10, 11, 250, 251)); - SetDefaultParentByPrimaryRootWindow(w1.get()); + ParentWindowInPrimaryRootWindow(w1.get()); w1->Show(); wm::ActivateWindow(w1.get()); diff --git a/ash/wm/workspace/multi_window_resize_controller_unittest.cc b/ash/wm/workspace/multi_window_resize_controller_unittest.cc index 9a3d43c..a4756aa 100644 --- a/ash/wm/workspace/multi_window_resize_controller_unittest.cc +++ b/ash/wm/workspace/multi_window_resize_controller_unittest.cc @@ -42,7 +42,7 @@ class MultiWindowResizeControllerTest : public test::AshTestBase { aura::Window* window = new aura::Window(delegate); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); - SetDefaultParentByPrimaryRootWindow(window); + ParentWindowInPrimaryRootWindow(window); window->SetBounds(bounds); window->Show(); return window; diff --git a/ash/wm/workspace/workspace_event_handler_unittest.cc b/ash/wm/workspace/workspace_event_handler_unittest.cc index 843d136..61d55bd 100644 --- a/ash/wm/workspace/workspace_event_handler_unittest.cc +++ b/ash/wm/workspace/workspace_event_handler_unittest.cc @@ -37,7 +37,7 @@ class WorkspaceEventHandlerTest : public test::AshTestBase { aura::Window* window = new aura::Window(delegate); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); - SetDefaultParentByPrimaryRootWindow(window); + ParentWindowInPrimaryRootWindow(window); window->SetBounds(bounds); window->Show(); return window; diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc index 6194f1c..f735e0c 100644 --- a/ash/wm/workspace/workspace_layout_manager_unittest.cc +++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc @@ -287,7 +287,7 @@ TEST_F(WorkspaceLayoutManagerTest, DontClobberRestoreBounds) { // NOTE: for this test to exercise the failure the observer needs to be added // before the parent set. This mimics what BrowserFrameAsh does. window->AddObserver(&window_observer); - SetDefaultParentByPrimaryRootWindow(window.get()); + ParentWindowInPrimaryRootWindow(window.get()); window->Show(); wm::WindowState* window_state = wm::GetWindowState(window.get()); diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index 9d6969b..f3efaa52 100644 --- a/ash/wm/workspace/workspace_window_resizer_unittest.cc +++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc @@ -119,25 +119,25 @@ class WorkspaceWindowResizerTest : public test::AshTestBase { window_.reset(new aura::Window(&delegate_)); window_->SetType(aura::client::WINDOW_TYPE_NORMAL); window_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(window_.get()); + ParentWindowInPrimaryRootWindow(window_.get()); window_->set_id(1); window2_.reset(new aura::Window(&delegate2_)); window2_->SetType(aura::client::WINDOW_TYPE_NORMAL); window2_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(window2_.get()); + ParentWindowInPrimaryRootWindow(window2_.get()); window2_->set_id(2); window3_.reset(new aura::Window(&delegate3_)); window3_->SetType(aura::client::WINDOW_TYPE_NORMAL); window3_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(window3_.get()); + ParentWindowInPrimaryRootWindow(window3_.get()); window3_->set_id(3); window4_.reset(new aura::Window(&delegate4_)); window4_->SetType(aura::client::WINDOW_TYPE_NORMAL); window4_->Init(ui::LAYER_NOT_DRAWN); - SetDefaultParentByPrimaryRootWindow(window4_.get()); + ParentWindowInPrimaryRootWindow(window4_.get()); window4_->set_id(4); } diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc index ecb8248..14ecd84 100644 --- a/ash/wm/workspace_controller_unittest.cc +++ b/ash/wm/workspace_controller_unittest.cc @@ -95,7 +95,7 @@ class WorkspaceControllerTest : public test::AshTestBase { window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); window->SetType(aura::client::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); - SetDefaultParentByPrimaryRootWindow(window); + ParentWindowInPrimaryRootWindow(window); return window; } @@ -241,7 +241,7 @@ TEST_F(WorkspaceControllerTest, ChangeBoundsOfNormalWindow) { TEST_F(WorkspaceControllerTest, SnapToGrid) { scoped_ptr<Window> w1(CreateTestWindowUnparented()); w1->SetBounds(gfx::Rect(1, 6, 25, 30)); - SetDefaultParentByPrimaryRootWindow(w1.get()); + ParentWindowInPrimaryRootWindow(w1.get()); // We are not aligning this anymore this way. When the window gets shown // the window is expected to be handled differently, but this cannot be // tested with this test. So the result of this test should be that the @@ -661,7 +661,7 @@ TEST_F(WorkspaceControllerTest, DontCrashOnChangeAndActivate) { // window active. shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); - SetDefaultParentByPrimaryRootWindow(w1.get()); + ParentWindowInPrimaryRootWindow(w1.get()); delegate.set_window(w1.get()); w1->Show(); } @@ -679,7 +679,7 @@ TEST_F(WorkspaceControllerTest, TransientParent) { scoped_ptr<Window> w1(CreateTestWindowUnparented()); Shell::GetInstance()->GetPrimaryRootWindow()->AddTransientChild(w1.get()); w1->SetBounds(gfx::Rect(10, 11, 250, 251)); - SetDefaultParentByPrimaryRootWindow(w1.get()); + ParentWindowInPrimaryRootWindow(w1.get()); w1->Show(); wm::ActivateWindow(w1.get()); @@ -703,7 +703,7 @@ TEST_F(WorkspaceControllerTest, TrackedByWorkspace) { scoped_ptr<Window> w2(CreateTestWindowUnparented()); w2->SetBounds(gfx::Rect(1, 6, 25, 30)); w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); - SetDefaultParentByPrimaryRootWindow(w2.get()); + ParentWindowInPrimaryRootWindow(w2.get()); w2->Show(); wm::GetWindowState(w2.get())->SetTrackedByWorkspace(false); wm::ActivateWindow(w2.get()); @@ -1163,7 +1163,7 @@ TEST_F(WorkspaceControllerTest, VerifyLayerOrdering) { gfx::Rect(5, 6, 7, 8), NULL)); browser->SetName("browser"); - SetDefaultParentByPrimaryRootWindow(browser.get()); + ParentWindowInPrimaryRootWindow(browser.get()); browser->Show(); wm::ActivateWindow(browser.get()); @@ -1179,7 +1179,7 @@ TEST_F(WorkspaceControllerTest, VerifyLayerOrdering) { gfx::Rect(5, 6, 7, 8), NULL); browser->AddTransientChild(status_bubble); - SetDefaultParentByPrimaryRootWindow(status_bubble); + ParentWindowInPrimaryRootWindow(status_bubble); status_bubble->SetName("status_bubble"); scoped_ptr<Window> app( @@ -1189,7 +1189,7 @@ TEST_F(WorkspaceControllerTest, VerifyLayerOrdering) { gfx::Rect(5, 6, 7, 8), NULL)); app->SetName("app"); - SetDefaultParentByPrimaryRootWindow(app.get()); + ParentWindowInPrimaryRootWindow(app.get()); aura::Window* parent = browser->parent(); @@ -1282,7 +1282,7 @@ TEST_F(WorkspaceControllerTest, DragFullscreenNonTrackedWindow) { aura::client::WINDOW_TYPE_NORMAL, gfx::Rect(5, 6, 7, 8), NULL)); - SetDefaultParentByPrimaryRootWindow(w1.get()); + ParentWindowInPrimaryRootWindow(w1.get()); w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); w1->Show(); wm::ActivateWindow(w1.get()); @@ -1331,7 +1331,7 @@ TEST_F(WorkspaceControllerTest, DragMaximizedNonTrackedWindow) { aura::client::WINDOW_TYPE_NORMAL, gfx::Rect(5, 6, 7, 8), NULL)); - SetDefaultParentByPrimaryRootWindow(w1.get()); + ParentWindowInPrimaryRootWindow(w1.get()); w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); w1->Show(); wm::ActivateWindow(w1.get()); @@ -1373,7 +1373,7 @@ TEST_F(WorkspaceControllerTest, SwitchFromModal) { scoped_ptr<Window> modal_window(CreateTestWindowUnparented()); modal_window->SetBounds(gfx::Rect(10, 11, 21, 22)); modal_window->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_SYSTEM); - SetDefaultParentByPrimaryRootWindow(modal_window.get()); + ParentWindowInPrimaryRootWindow(modal_window.get()); modal_window->Show(); wm::ActivateWindow(modal_window.get()); |