diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index 0ac3f7ef4b24c..30271ef64f24f 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -580,7 +580,7 @@ bool HandleWindowSnap(int action) { // Disable window snapping shortcut key for full screen window due to // http://crbug.com/135487. if (!window_state || - window_state->window()->type() != aura::client::WINDOW_TYPE_NORMAL || + window_state->window()->type() != ui::wm::WINDOW_TYPE_NORMAL || window_state->IsFullscreen()) { return false; } diff --git a/ash/display/screen_position_controller_unittest.cc b/ash/display/screen_position_controller_unittest.cc index a9996c25eb00c..bac66b6236dad 100644 --- a/ash/display/screen_position_controller_unittest.cc +++ b/ash/display/screen_position_controller_unittest.cc @@ -54,7 +54,7 @@ class ScreenPositionControllerTest : public test::AshTestBase { virtual void SetUp() OVERRIDE { AshTestBase::SetUp(); window_.reset(new aura::Window(&window_delegate_)); - window_->SetType(aura::client::WINDOW_TYPE_NORMAL); + window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); window_->Init(ui::LAYER_NOT_DRAWN); 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 32fb417231628..9e412688c256f 100644 --- a/ash/drag_drop/drag_drop_tracker.cc +++ b/ash/drag_drop/drag_drop_tracker.cc @@ -22,7 +22,7 @@ namespace { aura::Window* CreateCaptureWindow(aura::Window* context_root, aura::WindowDelegate* delegate) { aura::Window* window = new aura::Window(delegate); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_NOT_DRAWN); aura::client::ParentWindowWithContext(window, context_root, gfx::Rect()); window->Show(); diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index e439ac3b18a88..58088c7ca2cfe 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc @@ -51,7 +51,6 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/drag_drop_client.h" #include "ui/aura/client/tooltip_client.h" -#include "ui/aura/client/window_types.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" @@ -68,6 +67,7 @@ #include "ui/views/corewm/visibility_controller.h" #include "ui/views/view_model.h" #include "ui/views/view_model_utils.h" +#include "ui/wm/public/window_types.h" #if defined(OS_CHROMEOS) #include "ash/wm/boot_splash_screen_chromeos.h" @@ -288,7 +288,7 @@ RootWindowController* RootWindowController::ForTargetRootWindow() { aura::Window* RootWindowController::GetContainerForWindow( aura::Window* window) { aura::Window* container = window->parent(); - while (container && container->type() != aura::client::WINDOW_TYPE_UNKNOWN) + while (container && container->type() != ui::wm::WINDOW_TYPE_UNKNOWN) container = container->parent(); return container; } @@ -566,8 +566,8 @@ const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { const aura::Window* topmost_window = NULL; for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin(); iter != windows.rend(); ++iter) { - if (((*iter)->type() == aura::client::WINDOW_TYPE_NORMAL || - (*iter)->type() == aura::client::WINDOW_TYPE_PANEL) && + if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL || + (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) && (*iter)->layer()->GetTargetVisibility()) { topmost_window = *iter; break; diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc index d80f62d6f72fc..fbbed698f057e 100644 --- a/ash/root_window_controller_unittest.cc +++ b/ash/root_window_controller_unittest.cc @@ -177,7 +177,7 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) { unparented_control->GetNativeView()->parent()->id()); aura::Window* panel = CreateTestWindowInShellWithDelegateAndType( - NULL, aura::client::WINDOW_TYPE_PANEL, 0, gfx::Rect(700, 100, 100, 100)); + NULL, ui::wm::WINDOW_TYPE_PANEL, 0, gfx::Rect(700, 100, 100, 100)); EXPECT_EQ(root_windows[1], panel->GetRootWindow()); EXPECT_EQ(internal::kShellWindowId_PanelContainer, panel->parent()->id()); @@ -526,7 +526,7 @@ TEST_F(RootWindowControllerTest, DontDeleteWindowsNotOwnedByParent) { DestroyedWindowObserver observer1; aura::test::TestWindowDelegate delegate1; aura::Window* window1 = new aura::Window(&delegate1); - window1->SetType(aura::client::WINDOW_TYPE_CONTROL); + window1->SetType(ui::wm::WINDOW_TYPE_CONTROL); window1->set_owned_by_parent(false); observer1.SetWindow(window1); window1->Init(ui::LAYER_NOT_DRAWN); diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 8dac93d1d2eab..e8300d39465f8 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc @@ -345,7 +345,7 @@ class ShelfLayoutManagerTest : public ash::test::AshTestBase { aura::Window* CreateTestWindow() { aura::Window* window = new aura::Window(NULL); window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); ParentWindowInPrimaryRootWindow(window); return window; diff --git a/ash/shell/window_watcher.cc b/ash/shell/window_watcher.cc index 988985a5e46d1..f63eeec8fce79 100644 --- a/ash/shell/window_watcher.cc +++ b/ash/shell/window_watcher.cc @@ -93,15 +93,16 @@ aura::Window* WindowWatcher::GetWindowByID(ash::LauncherID id) { // aura::WindowObserver overrides: void WindowWatcher::OnWindowAdded(aura::Window* new_window) { - if (new_window->type() != aura::client::WINDOW_TYPE_NORMAL && - new_window->type() != aura::client::WINDOW_TYPE_PANEL) + if (new_window->type() != ui::wm::WINDOW_TYPE_NORMAL && + new_window->type() != ui::wm::WINDOW_TYPE_PANEL) return; static int image_count = 0; ShelfModel* model = Shell::GetInstance()->shelf_model(); LauncherItem item; - item.type = new_window->type() == aura::client::WINDOW_TYPE_PANEL ? - ash::TYPE_APP_PANEL : ash::TYPE_PLATFORM_APP; + item.type = new_window->type() == ui::wm::WINDOW_TYPE_PANEL + ? ash::TYPE_APP_PANEL + : ash::TYPE_PLATFORM_APP; ash::LauncherID id = model->next_id(); id_to_window_[id] = new_window; diff --git a/ash/shell/window_watcher_shelf_item_delegate.cc b/ash/shell/window_watcher_shelf_item_delegate.cc index ecb4308c944db..fd8be8e40f263 100644 --- a/ash/shell/window_watcher_shelf_item_delegate.cc +++ b/ash/shell/window_watcher_shelf_item_delegate.cc @@ -24,7 +24,7 @@ WindowWatcherShelfItemDelegate::~WindowWatcherShelfItemDelegate() { bool WindowWatcherShelfItemDelegate::ItemSelected(const ui::Event& event) { aura::Window* window = watcher_->GetWindowByID(id_); - if (window->type() == aura::client::WINDOW_TYPE_PANEL) + if (window->type() == ui::wm::WINDOW_TYPE_PANEL) wm::MoveWindowToEventRoot(window, event); window->Show(); wm::ActivateWindow(window); diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc index e48460dabd440..93cabc8ac7aa6 100644 --- a/ash/shell_unittest.cc +++ b/ash/shell_unittest.cc @@ -462,7 +462,7 @@ TEST_F(ShellTest, FullscreenWindowHidesShelf) { TEST_F(ShellTest, ToggleAutoHide) { scoped_ptr window(new aura::Window(NULL)); window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); ParentWindowInPrimaryRootWindow(window.get()); window->Show(); diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index 30ca1be45ad08..232690052a829 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -241,15 +241,12 @@ aura::Window* AshTestBase::CreateTestWindowInShellWithDelegate( int id, const gfx::Rect& bounds) { return CreateTestWindowInShellWithDelegateAndType( - delegate, - aura::client::WINDOW_TYPE_NORMAL, - id, - bounds); + delegate, ui::wm::WINDOW_TYPE_NORMAL, id, bounds); } aura::Window* AshTestBase::CreateTestWindowInShellWithDelegateAndType( aura::WindowDelegate* delegate, - aura::client::WindowType type, + ui::wm::WindowType type, int id, const gfx::Rect& bounds) { aura::Window* window = new aura::Window(delegate); diff --git a/ash/test/ash_test_base.h b/ash/test/ash_test_base.h index acb7d46978e03..e606bab80d443 100644 --- a/ash/test/ash_test_base.h +++ b/ash/test/ash_test_base.h @@ -13,8 +13,8 @@ #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/aura/client/window_types.h" #include "ui/views/test/test_views_delegate.h" +#include "ui/wm/public/window_types.h" #if defined(OS_WIN) #include "ui/base/win/scoped_ole_initializer.h" @@ -83,7 +83,7 @@ class AshTestBase : public testing::Test { const gfx::Rect& bounds); aura::Window* CreateTestWindowInShellWithDelegateAndType( aura::WindowDelegate* delegate, - aura::client::WindowType type, + ui::wm::WindowType type, int id, const gfx::Rect& bounds); diff --git a/ash/test/test_shelf_delegate.cc b/ash/test/test_shelf_delegate.cc index c880d2433fb7d..1a62cff64781f 100644 --- a/ash/test/test_shelf_delegate.cc +++ b/ash/test/test_shelf_delegate.cc @@ -36,7 +36,7 @@ void TestShelfDelegate::AddLauncherItem(aura::Window* window) { void TestShelfDelegate::AddLauncherItem(aura::Window* window, LauncherItemStatus status) { LauncherItem item; - if (window->type() == aura::client::WINDOW_TYPE_PANEL) + if (window->type() == ui::wm::WINDOW_TYPE_PANEL) item.type = TYPE_APP_PANEL; else item.type = TYPE_PLATFORM_APP; diff --git a/ash/test/test_shelf_item_delegate.cc b/ash/test/test_shelf_item_delegate.cc index b09d9d79d4446..ed875312b5fdc 100644 --- a/ash/test/test_shelf_item_delegate.cc +++ b/ash/test/test_shelf_item_delegate.cc @@ -19,7 +19,7 @@ TestShelfItemDelegate::~TestShelfItemDelegate() { bool TestShelfItemDelegate::ItemSelected(const ui::Event& event) { if (window_) { - if (window_->type() == aura::client::WINDOW_TYPE_PANEL) + if (window_->type() == ui::wm::WINDOW_TYPE_PANEL) wm::MoveWindowToEventRoot(window_, event); window_->Show(); wm::ActivateWindow(window_); diff --git a/ash/wm/always_on_top_controller.cc b/ash/wm/always_on_top_controller.cc index 44776feb31370..c0f73568cd09b 100644 --- a/ash/wm/always_on_top_controller.cc +++ b/ash/wm/always_on_top_controller.cc @@ -55,8 +55,8 @@ void AlwaysOnTopController::OnWindowPropertyChanged(aura::Window* window, const void* key, intptr_t old) { if (key == aura::client::kAlwaysOnTopKey) { - DCHECK(window->type() == aura::client::WINDOW_TYPE_NORMAL || - window->type() == aura::client::WINDOW_TYPE_POPUP); + DCHECK(window->type() == ui::wm::WINDOW_TYPE_NORMAL || + window->type() == ui::wm::WINDOW_TYPE_POPUP); aura::Window* container = GetContainer(window); if (window->parent() != container) container->AddChild(window); diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc index 3298f05602fce..d59a14df9df73 100644 --- a/ash/wm/dock/docked_window_layout_manager.cc +++ b/ash/wm/dock/docked_window_layout_manager.cc @@ -180,7 +180,7 @@ namespace { // Returns true if a window is a popup or a transient child. bool IsPopupOrTransient(const aura::Window* window) { - return (window->type() == aura::client::WINDOW_TYPE_POPUP || + return (window->type() == ui::wm::WINDOW_TYPE_POPUP || window->transient_parent()); } @@ -896,7 +896,7 @@ void DockedWindowLayoutManager::RecordUmaAction(DockedAction action, if (!IsUsedByLayout(window)) continue; docked_visible_count++; - if (window->type() == aura::client::WINDOW_TYPE_PANEL) + if (window->type() == ui::wm::WINDOW_TYPE_PANEL) docked_panels_count++; const wm::WindowState* window_state = wm::GetWindowState(window); if (window_state->HasRestoreBounds()) { diff --git a/ash/wm/dock/docked_window_layout_manager_unittest.cc b/ash/wm/dock/docked_window_layout_manager_unittest.cc index 54e642a30861f..a1284b9930906 100644 --- a/ash/wm/dock/docked_window_layout_manager_unittest.cc +++ b/ash/wm/dock/docked_window_layout_manager_unittest.cc @@ -40,7 +40,7 @@ namespace internal { class DockedWindowLayoutManagerTest : public test::AshTestBase, - public testing::WithParamInterface { + public testing::WithParamInterface { public: DockedWindowLayoutManagerTest() : window_type_(GetParam()) {} virtual ~DockedWindowLayoutManagerTest() {} @@ -73,7 +73,7 @@ class DockedWindowLayoutManagerTest aura::Window* CreateTestWindow(const gfx::Rect& bounds) { aura::Window* window = CreateTestWindowInShellWithDelegateAndType( NULL, window_type_, 0, bounds); - if (window_type_ == aura::client::WINDOW_TYPE_PANEL) { + if (window_type_ == ui::wm::WINDOW_TYPE_PANEL) { test::TestShelfDelegate* shelf_delegate = test::TestShelfDelegate::instance(); shelf_delegate->AddLauncherItem(window); @@ -90,7 +90,7 @@ class DockedWindowLayoutManagerTest aura::test::TestWindowDelegate* delegate) { aura::Window* window = CreateTestWindowInShellWithDelegateAndType( delegate, window_type_, 0, bounds); - if (window_type_ == aura::client::WINDOW_TYPE_PANEL) { + if (window_type_ == ui::wm::WINDOW_TYPE_PANEL) { test::TestShelfDelegate* shelf_delegate = test::TestShelfDelegate::instance(); shelf_delegate->AddLauncherItem(window); @@ -151,21 +151,19 @@ class DockedWindowLayoutManagerTest // All other windows that we are testing here have default container as a // parent. int CorrectContainerIdDuringDrag() { - if (window_type_ == aura::client::WINDOW_TYPE_PANEL) + if (window_type_ == ui::wm::WINDOW_TYPE_PANEL) return internal::kShellWindowId_PanelContainer; return internal::kShellWindowId_DockedContainer; } // Test dragging the window vertically (to detach if it is a panel) and then // horizontally to the edge with an added offset from the edge of |dx|. - void DragRelativeToEdge(DockedEdge edge, - aura::Window* window, - int dx) { + void DragRelativeToEdge(DockedEdge edge, aura::Window* window, int dx) { DragVerticallyAndRelativeToEdge( edge, window, dx, - window_type_ == aura::client::WINDOW_TYPE_PANEL ? -100 : 20); + window_type_ == ui::wm::WINDOW_TYPE_PANEL ? -100 : 20); } void DragToVerticalPositionAndToEdge(DockedEdge edge, @@ -216,7 +214,7 @@ class DockedWindowLayoutManagerTest private: scoped_ptr resizer_; scoped_ptr shelf_view_test_; - aura::client::WindowType window_type_; + ui::wm::WindowType window_type_; // Location at start of the drag in |window->parent()|'s coordinates. gfx::Point initial_location_in_parent_; @@ -813,7 +811,7 @@ TEST_P(DockedWindowLayoutManagerTest, TwoWindowsHeightRestrictions) { // Tests run twice - on both panels and normal windows INSTANTIATE_TEST_CASE_P(NormalOrPanel, DockedWindowLayoutManagerTest, - testing::Values(aura::client::WINDOW_TYPE_NORMAL, - aura::client::WINDOW_TYPE_PANEL)); + testing::Values(ui::wm::WINDOW_TYPE_NORMAL, + ui::wm::WINDOW_TYPE_PANEL)); } // namespace internal } // namespace ash diff --git a/ash/wm/dock/docked_window_resizer.cc b/ash/wm/dock/docked_window_resizer.cc index cd06beec370f4..2b589d2b11ef9 100644 --- a/ash/wm/dock/docked_window_resizer.cc +++ b/ash/wm/dock/docked_window_resizer.cc @@ -210,7 +210,7 @@ void DockedWindowResizer::StartedDragging() { // Reparent workspace windows during the drag to elevate them above workspace. // Other windows for which the DockedWindowResizer is instantiated include // panels and windows that are already docked. Those do not need reparenting. - if (GetTarget()->type() != aura::client::WINDOW_TYPE_PANEL && + if (GetTarget()->type() != ui::wm::WINDOW_TYPE_PANEL && GetTarget()->parent()->id() == kShellWindowId_DefaultContainer) { // The window is going to be reparented - avoid completing the drag. window_state->set_continue_drag_after_reparent(true); @@ -234,9 +234,8 @@ void DockedWindowResizer::FinishedDragging() { did_move_or_resize_ = false; aura::Window* window = GetTarget(); wm::WindowState* window_state = wm::GetWindowState(window); - const bool is_attached_panel = - window->type() == aura::client::WINDOW_TYPE_PANEL && - window_state->panel_attached(); + const bool is_attached_panel = window->type() == ui::wm::WINDOW_TYPE_PANEL && + window_state->panel_attached(); const bool is_resized = (details_.bounds_change & WindowResizer::kBoundsChange_Resizes) != 0; diff --git a/ash/wm/dock/docked_window_resizer_unittest.cc b/ash/wm/dock/docked_window_resizer_unittest.cc index 9bfe7217f961a..6b60403df60d6 100644 --- a/ash/wm/dock/docked_window_resizer_unittest.cc +++ b/ash/wm/dock/docked_window_resizer_unittest.cc @@ -39,7 +39,7 @@ namespace internal { class DockedWindowResizerTest : public test::AshTestBase, - public testing::WithParamInterface { + public testing::WithParamInterface { public: DockedWindowResizerTest() : model_(NULL), window_type_(GetParam()) {} virtual ~DockedWindowResizerTest() {} @@ -79,7 +79,7 @@ class DockedWindowResizerTest window_type_, 0, bounds); - if (window_type_ == aura::client::WINDOW_TYPE_PANEL) { + if (window_type_ == ui::wm::WINDOW_TYPE_PANEL) { test::TestShelfDelegate* shelf_delegate = test::TestShelfDelegate::instance(); shelf_delegate->AddLauncherItem(window); @@ -96,7 +96,7 @@ class DockedWindowResizerTest aura::Window* CreateModalWindow(const gfx::Rect& bounds) { aura::Window* window = new aura::Window(&delegate_); window->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_SYSTEM); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); window->Show(); @@ -169,7 +169,7 @@ class DockedWindowResizerTest // All other windows that are tested here are parented by dock container // during drags. int CorrectContainerIdDuringDrag() { - if (window_type_ == aura::client::WINDOW_TYPE_PANEL) + if (window_type_ == ui::wm::WINDOW_TYPE_PANEL) return internal::kShellWindowId_PanelContainer; return internal::kShellWindowId_DockedContainer; } @@ -182,8 +182,10 @@ class DockedWindowResizerTest DragVerticallyAndRelativeToEdge( edge, window, - dx, window_type_ == aura::client::WINDOW_TYPE_PANEL ? -100 : 20, - 25, 5); + dx, + window_type_ == ui::wm::WINDOW_TYPE_PANEL ? -100 : 20, + 25, + 5); } void DragToVerticalPositionAndToEdge(DockedEdge edge, @@ -236,9 +238,7 @@ class DockedWindowResizerTest } } - bool test_panels() const { - return window_type_ == aura::client::WINDOW_TYPE_PANEL; - } + bool test_panels() const { return window_type_ == ui::wm::WINDOW_TYPE_PANEL; } const gfx::Point& initial_location_in_parent() const { return initial_location_in_parent_; @@ -247,7 +247,7 @@ class DockedWindowResizerTest private: scoped_ptr resizer_; ShelfModel* model_; - aura::client::WindowType window_type_; + ui::wm::WindowType window_type_; aura::test::TestWindowDelegate delegate_; // Location at start of the drag in |window->parent()|'s coordinates. @@ -541,7 +541,7 @@ TEST_P(DockedWindowResizerTest, AttachOneAutoHideShelf) { EXPECT_EQ(internal::kShellWindowId_DockedContainer, w1->parent()->id()); scoped_ptr w2(CreateTestWindowInShellWithDelegateAndType( - NULL, aura::client::WINDOW_TYPE_NORMAL, 0, gfx::Rect(20, 20, 150, 20))); + NULL, ui::wm::WINDOW_TYPE_NORMAL, 0, gfx::Rect(20, 20, 150, 20))); wm::GetWindowState(w2.get())->Maximize(); EXPECT_EQ(internal::kShellWindowId_DefaultContainer, w2->parent()->id()); EXPECT_TRUE(wm::GetWindowState(w2.get())->IsMaximized()); @@ -1296,7 +1296,7 @@ TEST_P(DockedWindowResizerTest, DragWindowWithTransientChild) { // Create a window with a transient child. scoped_ptr window(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); scoped_ptr child(CreateTestWindowInShellWithDelegateAndType( - NULL, aura::client::WINDOW_TYPE_NORMAL, 0, gfx::Rect(20, 20, 150, 20))); + NULL, ui::wm::WINDOW_TYPE_NORMAL, 0, gfx::Rect(20, 20, 150, 20))); window->AddTransientChild(child.get()); if (window->parent() != child->parent()) window->parent()->AddChild(child.get()); @@ -1430,7 +1430,7 @@ TEST_P(DockedWindowResizerTest, SideSnapDocked) { // Tests run twice - on both panels and normal windows INSTANTIATE_TEST_CASE_P(NormalOrPanel, DockedWindowResizerTest, - testing::Values(aura::client::WINDOW_TYPE_NORMAL, - aura::client::WINDOW_TYPE_PANEL)); + testing::Values(ui::wm::WINDOW_TYPE_NORMAL, + ui::wm::WINDOW_TYPE_PANEL)); } // namespace internal } // namespace ash diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc index a524d67218103..b2644d4fb387a 100644 --- a/ash/wm/drag_window_resizer.cc +++ b/ash/wm/drag_window_resizer.cc @@ -232,9 +232,9 @@ void DragWindowResizer::UpdateDragWindow(const gfx::Rect& bounds, bool DragWindowResizer::ShouldAllowMouseWarp() { return (details_.window_component == HTCAPTION) && - !GetTarget()->transient_parent() && - (GetTarget()->type() == aura::client::WINDOW_TYPE_NORMAL || - GetTarget()->type() == aura::client::WINDOW_TYPE_PANEL); + !GetTarget()->transient_parent() && + (GetTarget()->type() == ui::wm::WINDOW_TYPE_NORMAL || + GetTarget()->type() == ui::wm::WINDOW_TYPE_PANEL); } TrayUser* DragWindowResizer::GetTrayUserItemAtPoint( @@ -246,9 +246,9 @@ TrayUser* DragWindowResizer::GetTrayUserItemAtPoint( // Check that this is a drag move operation from a suitable window. if (details_.window_component != HTCAPTION || GetTarget()->transient_parent() || - (GetTarget()->type() != aura::client::WINDOW_TYPE_NORMAL && - GetTarget()->type() != aura::client::WINDOW_TYPE_PANEL && - GetTarget()->type() != aura::client::WINDOW_TYPE_POPUP)) + (GetTarget()->type() != ui::wm::WINDOW_TYPE_NORMAL && + GetTarget()->type() != ui::wm::WINDOW_TYPE_PANEL && + GetTarget()->type() != ui::wm::WINDOW_TYPE_POPUP)) return NULL; // We only allow to drag the window onto a tray of it's own RootWindow. diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc index a9220d5cd33f7..8980640ada8ff 100644 --- a/ash/wm/drag_window_resizer_unittest.cc +++ b/ash/wm/drag_window_resizer_unittest.cc @@ -54,20 +54,20 @@ class DragWindowResizerTest : public test::AshTestBase { EXPECT_EQ(800, root_bounds.width()); Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); window_.reset(new aura::Window(&delegate_)); - window_->SetType(aura::client::WINDOW_TYPE_NORMAL); + window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); window_->Init(ui::LAYER_NOT_DRAWN); 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_->SetType(ui::wm::WINDOW_TYPE_NORMAL); always_on_top_window_->SetProperty(aura::client::kAlwaysOnTopKey, true); always_on_top_window_->Init(ui::LAYER_NOT_DRAWN); ParentWindowInPrimaryRootWindow(always_on_top_window_.get()); always_on_top_window_->set_id(2); system_modal_window_.reset(new aura::Window(&delegate3_)); - system_modal_window_->SetType(aura::client::WINDOW_TYPE_NORMAL); + system_modal_window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); system_modal_window_->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_SYSTEM); system_modal_window_->Init(ui::LAYER_NOT_DRAWN); @@ -75,20 +75,20 @@ class DragWindowResizerTest : public test::AshTestBase { system_modal_window_->set_id(3); transient_child_ = new aura::Window(&delegate4_); - transient_child_->SetType(aura::client::WINDOW_TYPE_NORMAL); + transient_child_->SetType(ui::wm::WINDOW_TYPE_NORMAL); transient_child_->Init(ui::LAYER_NOT_DRAWN); 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_->SetType(ui::wm::WINDOW_TYPE_NORMAL); transient_parent_->Init(ui::LAYER_NOT_DRAWN); 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_->SetType(ui::wm::WINDOW_TYPE_PANEL); panel_window_->Init(ui::LAYER_NOT_DRAWN); ParentWindowInPrimaryRootWindow(panel_window_.get()); } @@ -292,7 +292,7 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplaysActiveRoot) { aura::test::TestWindowDelegate delegate; scoped_ptr window(new aura::Window(&delegate)); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); ParentWindowInPrimaryRootWindow(window.get()); window->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), diff --git a/ash/wm/gestures/two_finger_drag_handler.cc b/ash/wm/gestures/two_finger_drag_handler.cc index 5cf98a68ab8e6..3f44a046ca191 100644 --- a/ash/wm/gestures/two_finger_drag_handler.cc +++ b/ash/wm/gestures/two_finger_drag_handler.cc @@ -8,7 +8,6 @@ #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace/snap_sizer.h" -#include "ui/aura/client/window_types.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" #include "ui/base/hit_test.h" @@ -16,6 +15,7 @@ #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/events/event.h" #include "ui/events/event_constants.h" +#include "ui/wm/public/window_types.h" namespace { @@ -98,7 +98,7 @@ bool TwoFingerDragHandler::ProcessGestureEvent(aura::Window* target, if (event.type() == ui::ET_GESTURE_BEGIN && event.details().touch_points() == 2) { if (!in_gesture_drag_ && window_state->IsNormalShowState() && - target->type() == aura::client::WINDOW_TYPE_NORMAL) { + target->type() == ui::wm::WINDOW_TYPE_NORMAL) { if (WindowComponentsAllowMoving(first_finger_hittest_, target->delegate()->GetNonClientComponent(event.location()))) { in_gesture_drag_ = true; @@ -120,7 +120,7 @@ bool TwoFingerDragHandler::ProcessGestureEvent(aura::Window* target, if (!in_gesture_drag_) { // Consume all two-finger gestures on a normal window. return event.details().touch_points() == 2 && - target->type() == aura::client::WINDOW_TYPE_NORMAL && + target->type() == ui::wm::WINDOW_TYPE_NORMAL && window_state->IsNormalShowState(); } // Since |in_gesture_drag_| is true a resizer was either created above or diff --git a/ash/wm/overview/window_selector.cc b/ash/wm/overview/window_selector.cc index f4d8bd08f698b..56ea4553cfb7c 100644 --- a/ash/wm/overview/window_selector.cc +++ b/ash/wm/overview/window_selector.cc @@ -275,7 +275,7 @@ WindowSelector::WindowSelector(const WindowList& windows, windows[i]->AddObserver(this); observed_windows_.insert(windows[i]); - if (windows[i]->type() == aura::client::WINDOW_TYPE_PANEL && + if (windows[i]->type() == ui::wm::WINDOW_TYPE_PANEL && wm::GetWindowState(windows[i])->panel_attached()) { // Attached panel windows are grouped into a single overview item per // root window (display). @@ -393,8 +393,8 @@ void WindowSelector::CancelSelection() { } void WindowSelector::OnWindowAdded(aura::Window* new_window) { - if (new_window->type() != aura::client::WINDOW_TYPE_NORMAL && - new_window->type() != aura::client::WINDOW_TYPE_PANEL) { + if (new_window->type() != ui::wm::WINDOW_TYPE_NORMAL && + new_window->type() != ui::wm::WINDOW_TYPE_PANEL) { return; } diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index 199f4a72c207c..e36155a55bafe 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc @@ -126,7 +126,7 @@ class WindowSelectorTest : public test::AshTestBase { aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { aura::Window* window = CreateTestWindowInShellWithDelegateAndType( - NULL, aura::client::WINDOW_TYPE_PANEL, 0, bounds); + NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); test::TestShelfDelegate::instance()->AddLauncherItem(window); shelf_view_test()->RunMessageLoopUntilAnimationsDone(); return window; diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc index ec7027b61290c..20678d3f07c96 100644 --- a/ash/wm/panels/panel_layout_manager.cc +++ b/ash/wm/panels/panel_layout_manager.cc @@ -341,7 +341,7 @@ void PanelLayoutManager::OnWindowResized() { } void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) { - if (child->type() == aura::client::WINDOW_TYPE_POPUP) + if (child->type() == ui::wm::WINDOW_TYPE_POPUP) return; if (in_add_window_) return; @@ -379,7 +379,7 @@ void PanelLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) { } void PanelLayoutManager::OnWindowRemovedFromLayout(aura::Window* child) { - if (child->type() == aura::client::WINDOW_TYPE_POPUP) + if (child->type() == ui::wm::WINDOW_TYPE_POPUP) return; PanelList::iterator found = std::find(panel_windows_.begin(), panel_windows_.end(), child); @@ -492,8 +492,7 @@ void PanelLayoutManager::OnWindowVisibilityChanged( void PanelLayoutManager::OnWindowActivated(aura::Window* gained_active, aura::Window* lost_active) { // Ignore if the panel that is not managed by this was activated. - if (gained_active && - gained_active->type() == aura::client::WINDOW_TYPE_PANEL && + if (gained_active && gained_active->type() == ui::wm::WINDOW_TYPE_PANEL && gained_active->parent() == panel_container_) { UpdateStacking(gained_active); UpdateCallouts(); diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc index 5351afa2b1c7d..e0ec0c586af82 100644 --- a/ash/wm/panels/panel_layout_manager_unittest.cc +++ b/ash/wm/panels/panel_layout_manager_unittest.cc @@ -63,10 +63,7 @@ class PanelLayoutManagerTest : public test::AshTestBase { aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { aura::Window* window = CreateTestWindowInShellWithDelegateAndType( - NULL, - aura::client::WINDOW_TYPE_PANEL, - 0, - bounds); + NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); test::TestShelfDelegate* shelf_delegate = test::TestShelfDelegate::instance(); shelf_delegate->AddLauncherItem(window); diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc index f264b2b2b94da..6d0b927cdad04 100644 --- a/ash/wm/panels/panel_window_resizer_unittest.cc +++ b/ash/wm/panels/panel_window_resizer_unittest.cc @@ -61,10 +61,7 @@ class PanelWindowResizerTest : public test::AshTestBase { aura::Window* CreatePanelWindow(const gfx::Point& origin) { gfx::Rect bounds(origin, gfx::Size(101, 101)); aura::Window* window = CreateTestWindowInShellWithDelegateAndType( - NULL, - aura::client::WINDOW_TYPE_PANEL, - 0, - bounds); + NULL, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); shelf_delegate_->AddLauncherItem(window); PanelLayoutManager* manager = static_cast( @@ -225,13 +222,13 @@ class PanelWindowResizerTextDirectionTest // transient children of supported types. class PanelWindowResizerTransientTest : public PanelWindowResizerTest, - public testing::WithParamInterface { + public testing::WithParamInterface { public: PanelWindowResizerTransientTest() : transient_window_type_(GetParam()) {} virtual ~PanelWindowResizerTransientTest() {} protected: - aura::client::WindowType transient_window_type_; + ui::wm::WindowType transient_window_type_; private: DISALLOW_COPY_AND_ASSIGN(PanelWindowResizerTransientTest); @@ -528,10 +525,11 @@ TEST_P(PanelWindowResizerTransientTest, PanelWithTransientChild) { INSTANTIATE_TEST_CASE_P(LtrRtl, PanelWindowResizerTextDirectionTest, testing::Bool()); -INSTANTIATE_TEST_CASE_P(NormalPanelPopup, PanelWindowResizerTransientTest, - testing::Values(aura::client::WINDOW_TYPE_NORMAL, - aura::client::WINDOW_TYPE_PANEL, - aura::client::WINDOW_TYPE_POPUP)); +INSTANTIATE_TEST_CASE_P(NormalPanelPopup, + PanelWindowResizerTransientTest, + testing::Values(ui::wm::WINDOW_TYPE_NORMAL, + ui::wm::WINDOW_TYPE_PANEL, + ui::wm::WINDOW_TYPE_POPUP)); } // namespace internal } // namespace ash diff --git a/ash/wm/solo_window_tracker.cc b/ash/wm/solo_window_tracker.cc index 633d3bd450e57..f35678cb49f17 100644 --- a/ash/wm/solo_window_tracker.cc +++ b/ash/wm/solo_window_tracker.cc @@ -56,11 +56,10 @@ bool GetTargetVisibility(aura::Window* child) { // * Modal alerts (it looks odd for headers to change when an alert opens) // * Constrained windows (ditto) bool IsValidCandidate(aura::Window* window) { - return window->type() == aura::client::WINDOW_TYPE_NORMAL && - window->layer() && - window->layer()->type() != ui::LAYER_NOT_DRAWN && - window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE && - !window->GetProperty(aura::client::kConstrainedWindowKey); + return window->type() == ui::wm::WINDOW_TYPE_NORMAL && window->layer() && + window->layer()->type() != ui::LAYER_NOT_DRAWN && + window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE && + !window->GetProperty(aura::client::kConstrainedWindowKey); } // Schedule's a paint of the window's entire bounds. diff --git a/ash/wm/solo_window_tracker_unittest.cc b/ash/wm/solo_window_tracker_unittest.cc index 431ae009556a2..c3629b1893a9f 100644 --- a/ash/wm/solo_window_tracker_unittest.cc +++ b/ash/wm/solo_window_tracker_unittest.cc @@ -74,7 +74,7 @@ class SoloWindowTrackerTest : public test::AshTestBase { // Helpers methods to create test windows in the primary root window. aura::Window* CreateWindowInPrimary() { aura::Window* window = new aura::Window(NULL); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); window->SetBounds(gfx::Rect(100, 100)); ParentWindowInPrimaryRootWindow(window); @@ -82,7 +82,7 @@ class SoloWindowTrackerTest : public test::AshTestBase { } aura::Window* CreateAlwaysOnTopWindowInPrimary() { aura::Window* window = new aura::Window(NULL); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); window->SetBounds(gfx::Rect(100, 100)); window->SetProperty(aura::client::kAlwaysOnTopKey, true); @@ -91,7 +91,7 @@ class SoloWindowTrackerTest : public test::AshTestBase { } aura::Window* CreatePanelWindowInPrimary() { aura::Window* window = new aura::Window(NULL); - window->SetType(aura::client::WINDOW_TYPE_PANEL); + window->SetType(ui::wm::WINDOW_TYPE_PANEL); window->Init(ui::LAYER_TEXTURED); window->SetBounds(gfx::Rect(100, 100)); ParentWindowInPrimaryRootWindow(window); @@ -296,7 +296,7 @@ TEST_F(SoloWindowTrackerTest, NotDrawn) { // Create non-drawing window similar to DragDropTracker. aura::Window* not_drawn = new aura::Window(NULL); - not_drawn->SetType(aura::client::WINDOW_TYPE_NORMAL); + not_drawn->SetType(ui::wm::WINDOW_TYPE_NORMAL); not_drawn->Init(ui::LAYER_NOT_DRAWN); ParentWindowInPrimaryRootWindow(not_drawn); not_drawn->Show(); @@ -395,7 +395,7 @@ TEST_F(SoloWindowTrackerTest, ChildWindowVisibility) { // Create a child window. This should not affect the solo-ness of |w1|. aura::Window* child = new aura::Window(NULL); - child->SetType(aura::client::WINDOW_TYPE_CONTROL); + child->SetType(ui::wm::WINDOW_TYPE_CONTROL); child->Init(ui::LAYER_TEXTURED); child->SetBounds(gfx::Rect(100, 100)); w->AddChild(child); diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc index 915eed41d4357..570c8f3c33e15 100644 --- a/ash/wm/stacking_controller.cc +++ b/ash/wm/stacking_controller.cc @@ -39,7 +39,7 @@ bool IsSystemModal(aura::Window* window) { bool HasTransientParentWindow(aura::Window* window) { return window->transient_parent() && - window->transient_parent()->type() != aura::client::WINDOW_TYPE_UNKNOWN; + window->transient_parent()->type() != ui::wm::WINDOW_TYPE_UNKNOWN; } internal::AlwaysOnTopController* @@ -74,27 +74,27 @@ aura::Window* StackingController::GetDefaultParent(aura::Window* context, } switch (window->type()) { - case aura::client::WINDOW_TYPE_NORMAL: - case aura::client::WINDOW_TYPE_POPUP: + case ui::wm::WINDOW_TYPE_NORMAL: + case ui::wm::WINDOW_TYPE_POPUP: if (IsSystemModal(window)) return GetSystemModalContainer(target_root, window); else if (HasTransientParentWindow(window)) return internal::RootWindowController::GetContainerForWindow( window->transient_parent()); return GetAlwaysOnTopController(target_root)->GetContainer(window); - case aura::client::WINDOW_TYPE_CONTROL: + case ui::wm::WINDOW_TYPE_CONTROL: return GetContainerById( target_root, internal::kShellWindowId_UnparentedControlContainer); - case aura::client::WINDOW_TYPE_PANEL: + case ui::wm::WINDOW_TYPE_PANEL: if (wm::GetWindowState(window)->panel_attached()) return GetContainerById(target_root, internal::kShellWindowId_PanelContainer); else return GetAlwaysOnTopController(target_root)->GetContainer(window); - case aura::client::WINDOW_TYPE_MENU: + case ui::wm::WINDOW_TYPE_MENU: return GetContainerById( target_root, internal::kShellWindowId_MenuContainer); - case aura::client::WINDOW_TYPE_TOOLTIP: + case ui::wm::WINDOW_TYPE_TOOLTIP: return GetContainerById( target_root, internal::kShellWindowId_DragImageAndTooltipContainer); default: diff --git a/ash/wm/stacking_controller_unittest.cc b/ash/wm/stacking_controller_unittest.cc index e0ccaa182be15..31ec8ffac120a 100644 --- a/ash/wm/stacking_controller_unittest.cc +++ b/ash/wm/stacking_controller_unittest.cc @@ -24,7 +24,7 @@ class StackingControllerTest : public test::AshTestBase { aura::Window* CreateTestWindow() { aura::Window* window = new aura::Window(NULL); window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); return window; } diff --git a/ash/wm/system_modal_container_layout_manager.cc b/ash/wm/system_modal_container_layout_manager.cc index 2c2cdebb57a5f..eaf3cdf083502 100644 --- a/ash/wm/system_modal_container_layout_manager.cc +++ b/ash/wm/system_modal_container_layout_manager.cc @@ -63,8 +63,8 @@ void SystemModalContainerLayoutManager::OnWindowResized() { void SystemModalContainerLayoutManager::OnWindowAddedToLayout( aura::Window* child) { DCHECK((modal_background_ && child == modal_background_->GetNativeView()) || - child->type() == aura::client::WINDOW_TYPE_NORMAL || - child->type() == aura::client::WINDOW_TYPE_POPUP); + child->type() == ui::wm::WINDOW_TYPE_NORMAL || + child->type() == ui::wm::WINDOW_TYPE_POPUP); DCHECK( container_->id() != internal::kShellWindowId_LockSystemModalContainer || Shell::GetInstance()->session_state_delegate()->IsUserSessionBlocked()); diff --git a/ash/wm/toplevel_window_event_handler_unittest.cc b/ash/wm/toplevel_window_event_handler_unittest.cc index 99e7418bb9dfb..4038779e97a9a 100644 --- a/ash/wm/toplevel_window_event_handler_unittest.cc +++ b/ash/wm/toplevel_window_event_handler_unittest.cc @@ -66,7 +66,7 @@ class ToplevelWindowEventHandlerTest : public AshTestBase { aura::Window* CreateWindow(int hittest_code) { TestWindowDelegate* d1 = new TestWindowDelegate(hittest_code); aura::Window* w1 = new aura::Window(d1); - w1->SetType(aura::client::WINDOW_TYPE_NORMAL); + w1->SetType(ui::wm::WINDOW_TYPE_NORMAL); w1->set_id(1); w1->Init(ui::LAYER_TEXTURED); aura::Window* parent = diff --git a/ash/wm/video_detector_unittest.cc b/ash/wm/video_detector_unittest.cc index 01c79cf879746..7c37d086398e7 100644 --- a/ash/wm/video_detector_unittest.cc +++ b/ash/wm/video_detector_unittest.cc @@ -12,11 +12,11 @@ #include "base/time/time.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/client/window_types.h" #include "ui/aura/root_window.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/gfx/rect.h" +#include "ui/wm/public/window_types.h" namespace ash { namespace test { diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index ea1b97e6944e5..15d4a1865d6c1 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -376,7 +376,7 @@ TEST_F(WindowManagerTest, PanelActivation) { &wd, -1, gfx::Rect(10, 10, 50, 50))); aura::test::TestWindowDelegate pd; scoped_ptr p1(CreateTestWindowInShellWithDelegateAndType( - &pd, aura::client::WINDOW_TYPE_PANEL, -1, gfx::Rect(10, 10, 50, 50))); + &pd, ui::wm::WINDOW_TYPE_PANEL, -1, gfx::Rect(10, 10, 50, 50))); aura::client::FocusClient* focus_client = aura::client::GetFocusClient(w1.get()); diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc index 9b31113f8c4d6..d0129f8f3ed8b 100644 --- a/ash/wm/window_positioner.cc +++ b/ash/wm/window_positioner.cc @@ -179,10 +179,8 @@ aura::Window* GetReferenceWindow(const aura::Window* root_window, aura::Window* found = NULL; for (int i = index + windows.size(); i >= 0; i--) { aura::Window* window = windows[i % windows.size()]; - if (window != exclude && - window->type() == aura::client::WINDOW_TYPE_NORMAL && - window->GetRootWindow() == root_window && - window->TargetVisibility() && + if (window != exclude && window->type() == ui::wm::WINDOW_TYPE_NORMAL && + window->GetRootWindow() == root_window && window->TargetVisibility() && wm::GetWindowState(window)->window_position_managed()) { if (found && found != window) { // no need to check !signle_window because the function must have diff --git a/ash/wm/window_state.cc b/ash/wm/window_state.cc index fdbe06fd28c44..548117ea8f597 100644 --- a/ash/wm/window_state.cc +++ b/ash/wm/window_state.cc @@ -132,8 +132,7 @@ bool WindowState::CanActivate() const { } bool WindowState::CanSnap() const { - if (!CanResize() || - window_->type() == aura::client::WINDOW_TYPE_PANEL || + if (!CanResize() || window_->type() == ui::wm::WINDOW_TYPE_PANEL || window_->transient_parent()) return false; // If a window has a maximum size defined, snapping may make it too big. diff --git a/ash/wm/workspace/multi_window_resize_controller_unittest.cc b/ash/wm/workspace/multi_window_resize_controller_unittest.cc index a4756aa729d75..12119f342bf44 100644 --- a/ash/wm/workspace/multi_window_resize_controller_unittest.cc +++ b/ash/wm/workspace/multi_window_resize_controller_unittest.cc @@ -40,7 +40,7 @@ class MultiWindowResizeControllerTest : public test::AshTestBase { aura::Window* CreateTestWindow(aura::WindowDelegate* delegate, const gfx::Rect& bounds) { aura::Window* window = new aura::Window(delegate); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); ParentWindowInPrimaryRootWindow(window); window->SetBounds(bounds); diff --git a/ash/wm/workspace/workspace_event_handler_unittest.cc b/ash/wm/workspace/workspace_event_handler_unittest.cc index b42c851359557..ffaf210b2cf8d 100644 --- a/ash/wm/workspace/workspace_event_handler_unittest.cc +++ b/ash/wm/workspace/workspace_event_handler_unittest.cc @@ -35,7 +35,7 @@ class WorkspaceEventHandlerTest : public test::AshTestBase { aura::Window* CreateTestWindow(aura::WindowDelegate* delegate, const gfx::Rect& bounds) { aura::Window* window = new aura::Window(delegate); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); ParentWindowInPrimaryRootWindow(window); window->SetBounds(bounds); diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc index d12fb15bb79ca..0040a6c2528f4 100644 --- a/ash/wm/workspace/workspace_layout_manager_unittest.cc +++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc @@ -315,7 +315,7 @@ class DontClobberRestoreBoundsWindowObserver : public aura::WindowObserver { TEST_F(WorkspaceLayoutManagerTest, DontClobberRestoreBounds) { DontClobberRestoreBoundsWindowObserver window_observer; scoped_ptr window(new aura::Window(NULL)); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); window->SetBounds(gfx::Rect(10, 20, 30, 40)); // NOTE: for this test to exercise the failure the observer needs to be added diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc index b8cd5049448f4..70bc38231e5b9 100644 --- a/ash/wm/workspace/workspace_window_resizer.cc +++ b/ash/wm/workspace/workspace_window_resizer.cc @@ -29,7 +29,6 @@ #include "base/memory/weak_ptr.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/screen_position_client.h" -#include "ui/aura/client/window_types.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/aura/window_delegate.h" @@ -37,6 +36,7 @@ #include "ui/compositor/layer.h" #include "ui/gfx/screen.h" #include "ui/gfx/transform.h" +#include "ui/wm/public/window_types.h" namespace ash { @@ -91,7 +91,7 @@ scoped_ptr CreateWindowResizer( window_resizer = internal::DragWindowResizer::Create( window_resizer, window, point_in_parent, window_component, source); } - if (window_resizer && window->type() == aura::client::WINDOW_TYPE_PANEL) { + if (window_resizer && window->type() == ui::wm::WINDOW_TYPE_PANEL) { window_resizer = PanelWindowResizer::Create( window_resizer, window, point_in_parent, window_component, source); } @@ -443,7 +443,7 @@ void WorkspaceWindowResizer::CompleteDrag(int event_flags) { // out of a maximized window, it's already in the normal show state when this // is called, so it does not matter. if (window_state()->IsNormalShowState() && - (window()->type() != aura::client::WINDOW_TYPE_PANEL || + (window()->type() != ui::wm::WINDOW_TYPE_PANEL || !window_state()->panel_attached() || dock_layout_->is_dragged_window_docked()) && (snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT)) { diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc index 599c4ea98e88a..16a45fc5c2440 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 { EXPECT_EQ(800, root_bounds.width()); Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); window_.reset(new aura::Window(&delegate_)); - window_->SetType(aura::client::WINDOW_TYPE_NORMAL); + window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); window_->Init(ui::LAYER_NOT_DRAWN); ParentWindowInPrimaryRootWindow(window_.get()); window_->set_id(1); window2_.reset(new aura::Window(&delegate2_)); - window2_->SetType(aura::client::WINDOW_TYPE_NORMAL); + window2_->SetType(ui::wm::WINDOW_TYPE_NORMAL); window2_->Init(ui::LAYER_NOT_DRAWN); ParentWindowInPrimaryRootWindow(window2_.get()); window2_->set_id(2); window3_.reset(new aura::Window(&delegate3_)); - window3_->SetType(aura::client::WINDOW_TYPE_NORMAL); + window3_->SetType(ui::wm::WINDOW_TYPE_NORMAL); window3_->Init(ui::LAYER_NOT_DRAWN); ParentWindowInPrimaryRootWindow(window3_.get()); window3_->set_id(3); window4_.reset(new aura::Window(&delegate4_)); - window4_->SetType(aura::client::WINDOW_TYPE_NORMAL); + window4_->SetType(ui::wm::WINDOW_TYPE_NORMAL); window4_->Init(ui::LAYER_NOT_DRAWN); ParentWindowInPrimaryRootWindow(window4_.get()); window4_->set_id(4); diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc index dbf114e0d0eda..54cf58cd9e241 100644 --- a/ash/wm/workspace_controller_unittest.cc +++ b/ash/wm/workspace_controller_unittest.cc @@ -85,7 +85,7 @@ class WorkspaceControllerTest : public test::AshTestBase { aura::Window* CreateTestWindowUnparented() { aura::Window* window = new aura::Window(NULL); window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); return window; } @@ -93,7 +93,7 @@ class WorkspaceControllerTest : public test::AshTestBase { aura::Window* CreateTestWindow() { aura::Window* window = new aura::Window(NULL); window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); ParentWindowInPrimaryRootWindow(window); return window; @@ -1114,12 +1114,8 @@ TEST_F(WorkspaceControllerTest, AnimatedNormToMaxToNormRepositionsRemaining) { // with a real browser the browser here has a transient child window // (corresponds to the status bubble). TEST_F(WorkspaceControllerTest, VerifyLayerOrdering) { - scoped_ptr browser( - aura::test::CreateTestWindowWithDelegate( - NULL, - aura::client::WINDOW_TYPE_NORMAL, - gfx::Rect(5, 6, 7, 8), - NULL)); + scoped_ptr browser(aura::test::CreateTestWindowWithDelegate( + NULL, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 6, 7, 8), NULL)); browser->SetName("browser"); ParentWindowInPrimaryRootWindow(browser.get()); browser->Show(); @@ -1131,21 +1127,16 @@ TEST_F(WorkspaceControllerTest, VerifyLayerOrdering) { aura::test::TestWindowDelegate::CreateSelfDestroyingDelegate(); status_bubble_delegate->set_can_focus(false); Window* status_bubble = - aura::test::CreateTestWindowWithDelegate( - status_bubble_delegate, - aura::client::WINDOW_TYPE_POPUP, - gfx::Rect(5, 6, 7, 8), - NULL); + aura::test::CreateTestWindowWithDelegate(status_bubble_delegate, + ui::wm::WINDOW_TYPE_POPUP, + gfx::Rect(5, 6, 7, 8), + NULL); browser->AddTransientChild(status_bubble); ParentWindowInPrimaryRootWindow(status_bubble); status_bubble->SetName("status_bubble"); - scoped_ptr app( - aura::test::CreateTestWindowWithDelegate( - NULL, - aura::client::WINDOW_TYPE_NORMAL, - gfx::Rect(5, 6, 7, 8), - NULL)); + scoped_ptr app(aura::test::CreateTestWindowWithDelegate( + NULL, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 6, 7, 8), NULL)); app->SetName("app"); ParentWindowInPrimaryRootWindow(app.get()); @@ -1281,11 +1272,8 @@ class WorkspaceControllerTestDragging TEST_P(WorkspaceControllerTestDragging, DragWindowOverlapShelf) { aura::test::TestWindowDelegate delegate; delegate.set_window_component(HTCAPTION); - scoped_ptr w1( - aura::test::CreateTestWindowWithDelegate(&delegate, - aura::client::WINDOW_TYPE_NORMAL, - gfx::Rect(5, 5, 100, 50), - NULL)); + scoped_ptr w1(aura::test::CreateTestWindowWithDelegate( + &delegate, ui::wm::WINDOW_TYPE_NORMAL, gfx::Rect(5, 5, 100, 50), NULL)); ParentWindowInPrimaryRootWindow(w1.get()); ShelfLayoutManager* shelf = shelf_layout_manager(); diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc index 77c0344a61264..29d93710b79b3 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc @@ -662,7 +662,7 @@ scoped_ptr CreateTestBrowserWindow( // Create a window. aura::Window* window = new aura::Window(NULL); window->set_id(0); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); window->Show(); @@ -728,7 +728,7 @@ class V1App : public TestBrowserWindow { // Create a window. native_window_.reset(new aura::Window(NULL)); native_window_->set_id(0); - native_window_->SetType(aura::client::WINDOW_TYPE_POPUP); + native_window_->SetType(ui::wm::WINDOW_TYPE_POPUP); native_window_->Init(ui::LAYER_TEXTURED); native_window_->Show(); diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc index ff2050aa0d069..ea403dac492db 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc @@ -2183,7 +2183,7 @@ void TabDragController::BringWindowUnderPointToFront( // already topmost and it is safe to return with no stacking change. if (*it == browser_window) return; - if ((*it)->type() != aura::client::WINDOW_TYPE_POPUP) { + if ((*it)->type() != ui::wm::WINDOW_TYPE_POPUP) { widget_window->StackAbove(*it); break; } diff --git a/content/DEPS b/content/DEPS index 9f3434a0b5825..cef847b2eb841 100644 --- a/content/DEPS +++ b/content/DEPS @@ -83,6 +83,7 @@ include_rules = [ "+ui/shell_dialogs", "+ui/snapshot", "+ui/surface", + "+ui/wm/public", # Content knows about grd files, but the specifics of how to get a resource # given its id is left to the embedder. "-ui/base/l10n", diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 2478b1ba88eae..dddc7b639b5c4 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -56,7 +56,6 @@ #include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/tooltip_client.h" #include "ui/aura/client/window_tree_client.h" -#include "ui/aura/client/window_types.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" @@ -76,6 +75,7 @@ #include "ui/gfx/screen.h" #include "ui/gfx/size_conversions.h" #include "ui/gfx/skia_util.h" +#include "ui/wm/public/window_types.h" #if defined(OS_WIN) #include "base/win/windows_version.h" @@ -515,7 +515,7 @@ void RenderWidgetHostViewAura::InitAsPopup( old_child->popup_parent_host_view_ = NULL; } popup_parent_host_view_->popup_child_host_view_ = this; - window_->SetType(aura::client::WINDOW_TYPE_MENU); + window_->SetType(ui::wm::WINDOW_TYPE_MENU); window_->Init(ui::LAYER_TEXTURED); window_->SetName("RenderWidgetHostViewAura"); @@ -533,7 +533,7 @@ void RenderWidgetHostViewAura::InitAsPopup( void RenderWidgetHostViewAura::InitAsFullscreen( RenderWidgetHostView* reference_host_view) { is_fullscreen_ = true; - window_->SetType(aura::client::WINDOW_TYPE_NORMAL); + window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); window_->Init(ui::LAYER_TEXTURED); window_->SetName("RenderWidgetHostViewAura"); window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 75ca4e6fca4b6..685f5b1071c3f 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -962,7 +962,7 @@ void WebContentsViewAura::PrepareOverscrollWindow() { web_contents_, current_overscroll_gesture_); overscroll_window_.reset(new aura::Window(overscroll_delegate)); - overscroll_window_->SetType(aura::client::WINDOW_TYPE_CONTROL); + overscroll_window_->SetType(ui::wm::WINDOW_TYPE_CONTROL); overscroll_window_->SetTransparent(true); overscroll_window_->Init(ui::LAYER_TEXTURED); overscroll_window_->layer()->SetMasksToBounds(false); @@ -1215,7 +1215,7 @@ void WebContentsViewAura::CreateView( aura::Env::CreateInstance(); window_.reset(new aura::Window(this)); window_->set_owned_by_parent(false); - window_->SetType(aura::client::WINDOW_TYPE_CONTROL); + window_->SetType(ui::wm::WINDOW_TYPE_CONTROL); window_->SetTransparent(false); window_->Init(ui::LAYER_NOT_DRAWN); aura::Window* root_window = context ? context->GetRootWindow() : NULL; diff --git a/ui/aura/DEPS b/ui/aura/DEPS index c2522180289d2..6ee093b95b964 100644 --- a/ui/aura/DEPS +++ b/ui/aura/DEPS @@ -10,5 +10,6 @@ include_rules = [ "+ui/metro_viewer", # TODO(beng): investigate moving remote_root_window_host # to ui/metro_viewer. "+ui/ozone", + "+ui/wm/public", ] diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp index 928501a51a049..bc7b98061fb30 100644 --- a/ui/aura/aura.gyp +++ b/ui/aura/aura.gyp @@ -76,7 +76,6 @@ 'client/window_stacking_client.h', 'client/window_tree_client.cc', 'client/window_tree_client.h', - 'client/window_types.h', 'device_list_updater_aurax11.cc', 'device_list_updater_aurax11.h', 'dispatcher_win.cc', diff --git a/ui/aura/test/aura_test_base.cc b/ui/aura/test/aura_test_base.cc index 83937661bda4a..4522c98a94cea 100644 --- a/ui/aura/test/aura_test_base.cc +++ b/ui/aura/test/aura_test_base.cc @@ -100,7 +100,7 @@ Window* AuraTestBase::CreateNormalWindow(int id, Window* parent, Window* AuraTestBase::CreateTransientChild(int id, Window* parent) { Window* window = new Window(NULL); window->set_id(id); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); aura::client::ParentWindowWithContext(window, root_window(), gfx::Rect()); parent->AddTransientChild(window); diff --git a/ui/aura/test/test_windows.cc b/ui/aura/test/test_windows.cc index 8f1c21d3b3d39..48ee5752cc65e 100644 --- a/ui/aura/test/test_windows.cc +++ b/ui/aura/test/test_windows.cc @@ -34,15 +34,11 @@ Window* CreateTestWindowWithDelegate(WindowDelegate* delegate, const gfx::Rect& bounds, Window* parent) { return CreateTestWindowWithDelegateAndType( - delegate, - aura::client::WINDOW_TYPE_NORMAL, - id, - bounds, - parent); + delegate, ui::wm::WINDOW_TYPE_NORMAL, id, bounds, parent); } Window* CreateTestWindowWithDelegateAndType(WindowDelegate* delegate, - client::WindowType type, + ui::wm::WindowType type, int id, const gfx::Rect& bounds, Window* parent) { diff --git a/ui/aura/test/test_windows.h b/ui/aura/test/test_windows.h index e99fa6261919f..ef6a2f027cdf1 100644 --- a/ui/aura/test/test_windows.h +++ b/ui/aura/test/test_windows.h @@ -9,9 +9,9 @@ #include "base/compiler_specific.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/aura/client/window_types.h" -#include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/aura_test_base.h" +#include "ui/aura/test/test_window_delegate.h" +#include "ui/wm/public/window_types.h" namespace aura { namespace test { @@ -27,7 +27,7 @@ Window* CreateTestWindowWithDelegate(WindowDelegate* delegate, const gfx::Rect& bounds, Window* parent); Window* CreateTestWindowWithDelegateAndType(WindowDelegate* delegate, - client::WindowType type, + ui::wm::WindowType type, int id, const gfx::Rect& bounds, Window* parent); diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 4836a15aae09e..404ad155d9d93 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -214,7 +214,7 @@ class ScopedCursorHider { Window::Window(WindowDelegate* delegate) : dispatcher_(NULL), - type_(client::WINDOW_TYPE_UNKNOWN), + type_(ui::wm::WINDOW_TYPE_UNKNOWN), owned_by_parent_(true), delegate_(delegate), parent_(NULL), @@ -348,7 +348,7 @@ ui::Layer* Window::RecreateLayer() { return old_layer; } -void Window::SetType(client::WindowType type) { +void Window::SetType(ui::wm::WindowType type) { // Cannot change type after the window is initialized. DCHECK(!layer_); type_ = type; diff --git a/ui/aura/window.h b/ui/aura/window.h index d69d88e0089aa..6b65be490345b 100644 --- a/ui/aura/window.h +++ b/ui/aura/window.h @@ -15,7 +15,6 @@ #include "base/observer_list.h" #include "base/strings/string16.h" #include "ui/aura/aura_export.h" -#include "ui/aura/client/window_types.h" #include "ui/aura/window_layer_type.h" #include "ui/aura/window_observer.h" #include "ui/compositor/layer_animator.h" @@ -29,6 +28,7 @@ #include "ui/gfx/insets.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/rect.h" +#include "ui/wm/public/window_types.h" namespace gfx { class Display; @@ -100,8 +100,8 @@ class AURA_EXPORT Window : public ui::LayerDelegate, // A type is used to identify a class of Windows and customize behavior such // as event handling and parenting. This field should only be consumed by the // shell -- Aura itself shouldn't contain type-specific logic. - client::WindowType type() const { return type_; } - void SetType(client::WindowType type); + ui::wm::WindowType type() const { return type_; } + void SetType(ui::wm::WindowType type); int id() const { return id_; } void set_id(int id) { id_ = id; } @@ -548,7 +548,7 @@ class AURA_EXPORT Window : public ui::LayerDelegate, WindowEventDispatcher* dispatcher_; - client::WindowType type_; + ui::wm::WindowType type_; // True if the Window is owned by its parent - i.e. it will be deleted by its // parent during its parents destruction. True is the default. diff --git a/ui/oak/oak_aura_window_display.cc b/ui/oak/oak_aura_window_display.cc index e751a332393ff..c78d0cdd22e2d 100644 --- a/ui/oak/oak_aura_window_display.cc +++ b/ui/oak/oak_aura_window_display.cc @@ -43,25 +43,25 @@ ROW_COUNT base::string16 PropertyWithWindowType(int type) { std::string property = "Type: "; switch (type) { - case aura::client::WINDOW_TYPE_UNKNOWN: + case ui::wm::WINDOW_TYPE_UNKNOWN: property.append("WINDOW_TYPE_UNKNOWN"); break; - case aura::client::WINDOW_TYPE_NORMAL: + case ui::wm::WINDOW_TYPE_NORMAL: property.append("WINDOW_TYPE_NORMAL"); break; - case aura::client::WINDOW_TYPE_POPUP: + case ui::wm::WINDOW_TYPE_POPUP: property.append("WINDOW_TYPE_POPUP"); break; - case aura::client::WINDOW_TYPE_CONTROL: + case ui::wm::WINDOW_TYPE_CONTROL: property.append("WINDOW_TYPE_CONTROL"); break; - case aura::client::WINDOW_TYPE_PANEL: + case ui::wm::WINDOW_TYPE_PANEL: property.append("WINDOW_TYPE_PANEL"); break; - case aura::client::WINDOW_TYPE_MENU: + case ui::wm::WINDOW_TYPE_MENU: property.append("WINDOW_TYPE_MENU"); break; - case aura::client::WINDOW_TYPE_TOOLTIP: + case ui::wm::WINDOW_TYPE_TOOLTIP: property.append("WINDOW_TYPE_TOOLTIP"); break; default: diff --git a/ui/views/DEPS b/ui/views/DEPS index 4291fb99bed98..a74bffc716194 100644 --- a/ui/views/DEPS +++ b/ui/views/DEPS @@ -9,8 +9,9 @@ include_rules = [ "+ui/compositor", "+ui/events", "+ui/gfx", - "+ui/ozone", "+ui/native_theme", + "+ui/ozone", + "+ui/wm/public", "-testing/gmock", ] diff --git a/ui/views/corewm/shadow_controller.cc b/ui/views/corewm/shadow_controller.cc index 49307d8e2d29c..eb096169484bc 100644 --- a/ui/views/corewm/shadow_controller.cc +++ b/ui/views/corewm/shadow_controller.cc @@ -29,10 +29,10 @@ namespace { ShadowType GetShadowTypeFromWindow(aura::Window* window) { switch (window->type()) { - case aura::client::WINDOW_TYPE_NORMAL: - case aura::client::WINDOW_TYPE_PANEL: - case aura::client::WINDOW_TYPE_MENU: - case aura::client::WINDOW_TYPE_TOOLTIP: + case ui::wm::WINDOW_TYPE_NORMAL: + case ui::wm::WINDOW_TYPE_PANEL: + case ui::wm::WINDOW_TYPE_MENU: + case ui::wm::WINDOW_TYPE_TOOLTIP: return SHADOW_TYPE_RECTANGULAR; default: break; @@ -42,8 +42,8 @@ ShadowType GetShadowTypeFromWindow(aura::Window* window) { bool ShouldUseSmallShadowForWindow(aura::Window* window) { switch (window->type()) { - case aura::client::WINDOW_TYPE_MENU: - case aura::client::WINDOW_TYPE_TOOLTIP: + case ui::wm::WINDOW_TYPE_MENU: + case ui::wm::WINDOW_TYPE_TOOLTIP: return true; default: break; diff --git a/ui/views/corewm/shadow_controller_unittest.cc b/ui/views/corewm/shadow_controller_unittest.cc index 4140f7d83fb5b..3d32d6af571a2 100644 --- a/ui/views/corewm/shadow_controller_unittest.cc +++ b/ui/views/corewm/shadow_controller_unittest.cc @@ -55,7 +55,7 @@ class ShadowControllerTest : public aura::test::AuraTestBase { // Tests that various methods in Window update the Shadow object as expected. TEST_F(ShadowControllerTest, Shadow) { scoped_ptr window(new aura::Window(NULL)); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); ParentWindow(window.get()); @@ -91,7 +91,7 @@ TEST_F(ShadowControllerTest, Shadow) { // Tests that the window's shadow's bounds are updated correctly. TEST_F(ShadowControllerTest, ShadowBounds) { scoped_ptr window(new aura::Window(NULL)); - window->SetType(aura::client::WINDOW_TYPE_NORMAL); + window->SetType(ui::wm::WINDOW_TYPE_NORMAL); window->Init(ui::LAYER_TEXTURED); ParentWindow(window.get()); window->Show(); @@ -120,7 +120,7 @@ TEST_F(ShadowControllerTest, ShadowStyle) { ShadowController::TestApi api(shadow_controller()); scoped_ptr window1(new aura::Window(NULL)); - window1->SetType(aura::client::WINDOW_TYPE_NORMAL); + window1->SetType(ui::wm::WINDOW_TYPE_NORMAL); window1->Init(ui::LAYER_TEXTURED); ParentWindow(window1.get()); window1->SetBounds(gfx::Rect(10, 20, 300, 400)); @@ -134,7 +134,7 @@ TEST_F(ShadowControllerTest, ShadowStyle) { // Create another window and activate it. scoped_ptr window2(new aura::Window(NULL)); - window2->SetType(aura::client::WINDOW_TYPE_NORMAL); + window2->SetType(ui::wm::WINDOW_TYPE_NORMAL); window2->Init(ui::LAYER_TEXTURED); ParentWindow(window2.get()); window2->SetBounds(gfx::Rect(11, 21, 301, 401)); @@ -153,7 +153,7 @@ TEST_F(ShadowControllerTest, SmallShadowsForTooltipsAndMenus) { ShadowController::TestApi api(shadow_controller()); scoped_ptr tooltip_window(new aura::Window(NULL)); - tooltip_window->SetType(aura::client::WINDOW_TYPE_TOOLTIP); + tooltip_window->SetType(ui::wm::WINDOW_TYPE_TOOLTIP); tooltip_window->Init(ui::LAYER_TEXTURED); ParentWindow(tooltip_window.get()); tooltip_window->SetBounds(gfx::Rect(10, 20, 300, 400)); @@ -164,7 +164,7 @@ TEST_F(ShadowControllerTest, SmallShadowsForTooltipsAndMenus) { EXPECT_EQ(Shadow::STYLE_SMALL, tooltip_shadow->style()); scoped_ptr menu_window(new aura::Window(NULL)); - menu_window->SetType(aura::client::WINDOW_TYPE_MENU); + menu_window->SetType(ui::wm::WINDOW_TYPE_MENU); menu_window->Init(ui::LAYER_TEXTURED); ParentWindow(menu_window.get()); menu_window->SetBounds(gfx::Rect(10, 20, 300, 400)); @@ -181,7 +181,7 @@ TEST_F(ShadowControllerTest, TransientParentKeepsActiveShadow) { ShadowController::TestApi api(shadow_controller()); scoped_ptr window1(new aura::Window(NULL)); - window1->SetType(aura::client::WINDOW_TYPE_NORMAL); + window1->SetType(ui::wm::WINDOW_TYPE_NORMAL); window1->Init(ui::LAYER_TEXTURED); ParentWindow(window1.get()); window1->SetBounds(gfx::Rect(10, 20, 300, 400)); @@ -197,7 +197,7 @@ TEST_F(ShadowControllerTest, TransientParentKeepsActiveShadow) { // deactivate' property set. Upon activation, window1 should still have an // active shadow. scoped_ptr window2(new aura::Window(NULL)); - window2->SetType(aura::client::WINDOW_TYPE_NORMAL); + window2->SetType(ui::wm::WINDOW_TYPE_NORMAL); window2->Init(ui::LAYER_TEXTURED); ParentWindow(window2.get()); window2->SetBounds(gfx::Rect(11, 21, 301, 401)); diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc index f01ef9ce8642c..8407661fbe3a6 100644 --- a/ui/views/corewm/tooltip_controller_unittest.cc +++ b/ui/views/corewm/tooltip_controller_unittest.cc @@ -8,7 +8,6 @@ #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/tooltip_client.h" -#include "ui/aura/client/window_types.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/test/aura_test_base.h" @@ -26,6 +25,7 @@ #include "ui/views/view.h" #include "ui/views/widget/tooltip_manager.h" #include "ui/views/widget/widget.h" +#include "ui/wm/public/window_types.h" #if defined(OS_WIN) #include "ui/base/win/scoped_ole_initializer.h" @@ -595,8 +595,7 @@ TEST_F(TooltipControllerTest, TooltipsInMultipleRootWindows) { bool tooltip_reparented = false; for (size_t i = 0; i < root_window2->children().size(); ++i) { - if (root_window2->children()[i]->type() == - aura::client::WINDOW_TYPE_TOOLTIP) { + if (root_window2->children()[i]->type() == ui::wm::WINDOW_TYPE_TOOLTIP) { tooltip_reparented = true; break; } @@ -642,7 +641,7 @@ TEST_F(TooltipControllerTest, TooltipAtTopOfZOrderAfterActivation) { EXPECT_EQ( widget_->GetNativeWindow()->GetRootWindow()->children().back()->type(), - aura::client::WINDOW_TYPE_TOOLTIP); + ui::wm::WINDOW_TYPE_TOOLTIP); } #endif diff --git a/ui/views/corewm/visibility_controller.cc b/ui/views/corewm/visibility_controller.cc index 4542f41c6697f..c34f4f379f868 100644 --- a/ui/views/corewm/visibility_controller.cc +++ b/ui/views/corewm/visibility_controller.cc @@ -40,8 +40,8 @@ bool VisibilityController::CallAnimateOnChildWindowVisibilityChanged( void VisibilityController::UpdateLayerVisibility(aura::Window* window, bool visible) { - bool animated = window->type() != aura::client::WINDOW_TYPE_CONTROL && - window->type() != aura::client::WINDOW_TYPE_UNKNOWN && + bool animated = window->type() != ui::wm::WINDOW_TYPE_CONTROL && + window->type() != ui::wm::WINDOW_TYPE_UNKNOWN && ShouldAnimateWindow(window); animated = animated && CallAnimateOnChildWindowVisibilityChanged(window, visible); diff --git a/ui/views/corewm/visibility_controller_unittest.cc b/ui/views/corewm/visibility_controller_unittest.cc index 222d7af61e8b2..1cf90aa5e1822 100644 --- a/ui/views/corewm/visibility_controller_unittest.cc +++ b/ui/views/corewm/visibility_controller_unittest.cc @@ -31,12 +31,14 @@ TEST_F(VisibilityControllerTest, AnimateHideDoesntHideWindowLayer) { SetChildWindowVisibilityChangesAnimated(root_window()); aura::test::TestWindowDelegate d; - scoped_ptr animatable( - aura::test::CreateTestWindowWithDelegate( - &d, -2, gfx::Rect(0, 0, 50, 50), root_window())); + scoped_ptr animatable(aura::test::CreateTestWindowWithDelegate( + &d, -2, gfx::Rect(0, 0, 50, 50), root_window())); scoped_ptr non_animatable( aura::test::CreateTestWindowWithDelegateAndType( - &d, aura::client::WINDOW_TYPE_CONTROL, -3, gfx::Rect(51, 51, 50, 50), + &d, + ui::wm::WINDOW_TYPE_CONTROL, + -3, + gfx::Rect(51, 51, 50, 50), root_window())); EXPECT_TRUE(animatable->IsVisible()); EXPECT_TRUE(animatable->layer()->visible()); diff --git a/ui/views/corewm/window_animations.cc b/ui/views/corewm/window_animations.cc index 736f4bba82271..d5d4da7f3cf28 100644 --- a/ui/views/corewm/window_animations.cc +++ b/ui/views/corewm/window_animations.cc @@ -87,7 +87,7 @@ const int kWindowAnimation_Bounce_GrowShrinkDurationPercent = 40; base::TimeDelta GetWindowVisibilityAnimationDuration(aura::Window* window) { int duration = window->GetProperty(kWindowVisibilityAnimationDurationKey); - if (duration == 0 && window->type() == aura::client::WINDOW_TYPE_MENU) { + if (duration == 0 && window->type() == ui::wm::WINDOW_TYPE_MENU) { return base::TimeDelta::FromMilliseconds( kDefaultAnimationDurationForMenuMS); } @@ -99,10 +99,10 @@ base::TimeDelta GetWindowVisibilityAnimationDuration(aura::Window* window) { int GetWindowVisibilityAnimationType(aura::Window* window) { int type = window->GetProperty(kWindowVisibilityAnimationTypeKey); if (type == WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT) { - return (window->type() == aura::client::WINDOW_TYPE_MENU || - window->type() == aura::client::WINDOW_TYPE_TOOLTIP) ? - WINDOW_VISIBILITY_ANIMATION_TYPE_FADE : - WINDOW_VISIBILITY_ANIMATION_TYPE_DROP; + return (window->type() == ui::wm::WINDOW_TYPE_MENU || + window->type() == ui::wm::WINDOW_TYPE_TOOLTIP) + ? WINDOW_VISIBILITY_ANIMATION_TYPE_FADE + : WINDOW_VISIBILITY_ANIMATION_TYPE_DROP; } return type; } diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc index 4db5a00e7cf6e..e95e67e9dc9b9 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc @@ -161,7 +161,7 @@ class DesktopNativeWidgetAuraWindowTreeClient : const gfx::Rect& bounds) OVERRIDE { bool is_fullscreen = window->GetProperty(aura::client::kShowStateKey) == ui::SHOW_STATE_FULLSCREEN; - bool is_menu = window->type() == aura::client::WINDOW_TYPE_MENU; + bool is_menu = window->type() == ui::wm::WINDOW_TYPE_MENU; if (is_fullscreen || is_menu) { return DesktopNativeWidgetTopLevelHandler::CreateParentWindow( window, bounds, is_fullscreen); diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc index de0ae61087d27..76733d0ec3889 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc @@ -162,7 +162,7 @@ void DesktopRootWindowHostWin::OnRootWindowCreated( root_window_->window()->SetProperty(kDesktopRootWindowHostKey, this); should_animate_window_close_ = - content_window_->type() != aura::client::WINDOW_TYPE_NORMAL && + content_window_->type() != ui::wm::WINDOW_TYPE_NORMAL && !views::corewm::WindowAnimationsDisabled(content_window_); // TODO this is not invoked *after* Init(), but should be ok. diff --git a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc index a16b24b6427a4..9041799b16054 100644 --- a/ui/views/widget/desktop_aura/desktop_screen_position_client.cc +++ b/ui/views/widget/desktop_aura/desktop_screen_position_client.cc @@ -27,8 +27,8 @@ gfx::Point GetOrigin(const aura::Window* root_window) { // Returns true if bounds passed to window are treated as though they are in // screen coordinates. bool PositionWindowInScreenCoordinates(aura::Window* window) { - if (window->type() == aura::client::WINDOW_TYPE_POPUP || - window->type() == aura::client::WINDOW_TYPE_TOOLTIP) + if (window->type() == ui::wm::WINDOW_TYPE_POPUP || + window->type() == ui::wm::WINDOW_TYPE_TOOLTIP) return true; Widget* widget = Widget::GetWidgetForNativeView(window); diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index d395fa740fb3c..1f97ac1292476 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -15,7 +15,6 @@ #include "ui/aura/client/screen_position_client.h" #include "ui/aura/client/window_move_client.h" #include "ui/aura/client/window_tree_client.h" -#include "ui/aura/client/window_types.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" @@ -39,6 +38,7 @@ #include "ui/views/widget/widget_aura_utils.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/window_reorderer.h" +#include "ui/wm/public/window_types.h" #if defined(OS_WIN) #include "base/win/scoped_gdi_object.h" @@ -130,7 +130,7 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { if (!params.child) { // Set up the transient child before the window is added. This way the // LayoutManager knows the window has a transient parent. - if (parent && parent->type() != aura::client::WINDOW_TYPE_UNKNOWN) { + if (parent && parent->type() != ui::wm::WINDOW_TYPE_UNKNOWN) { parent->AddTransientChild(window_); if (!context) context = parent; diff --git a/ui/views/widget/widget_aura_utils.cc b/ui/views/widget/widget_aura_utils.cc index 348f828ff8fc8..be284a8af8141 100644 --- a/ui/views/widget/widget_aura_utils.cc +++ b/ui/views/widget/widget_aura_utils.cc @@ -8,27 +8,27 @@ namespace views { -aura::client::WindowType GetAuraWindowTypeForWidgetType( +ui::wm::WindowType GetAuraWindowTypeForWidgetType( Widget::InitParams::Type type) { switch (type) { case Widget::InitParams::TYPE_WINDOW: - return aura::client::WINDOW_TYPE_NORMAL; + return ui::wm::WINDOW_TYPE_NORMAL; case Widget::InitParams::TYPE_PANEL: - return aura::client::WINDOW_TYPE_PANEL; + return ui::wm::WINDOW_TYPE_PANEL; case Widget::InitParams::TYPE_CONTROL: - return aura::client::WINDOW_TYPE_CONTROL; + return ui::wm::WINDOW_TYPE_CONTROL; case Widget::InitParams::TYPE_WINDOW_FRAMELESS: case Widget::InitParams::TYPE_POPUP: case Widget::InitParams::TYPE_BUBBLE: case Widget::InitParams::TYPE_DRAG: - return aura::client::WINDOW_TYPE_POPUP; + return ui::wm::WINDOW_TYPE_POPUP; case Widget::InitParams::TYPE_MENU: - return aura::client::WINDOW_TYPE_MENU; + return ui::wm::WINDOW_TYPE_MENU; case Widget::InitParams::TYPE_TOOLTIP: - return aura::client::WINDOW_TYPE_TOOLTIP; + return ui::wm::WINDOW_TYPE_TOOLTIP; default: NOTREACHED() << "Unhandled widget type " << type; - return aura::client::WINDOW_TYPE_UNKNOWN; + return ui::wm::WINDOW_TYPE_UNKNOWN; } } diff --git a/ui/views/widget/widget_aura_utils.h b/ui/views/widget/widget_aura_utils.h index 8f0bfcc0358d2..4b16de48cab00 100644 --- a/ui/views/widget/widget_aura_utils.h +++ b/ui/views/widget/widget_aura_utils.h @@ -5,14 +5,14 @@ #ifndef UI_VIEWS_WIDGET_WIDGET_AURA_UTILS_H_ #define UI_VIEWS_WIDGET_WIDGET_AURA_UTILS_H_ -#include "ui/aura/client/window_types.h" #include "ui/views/widget/widget.h" +#include "ui/wm/public/window_types.h" // Functions shared by native_widget_aura.cc and desktop_native_widget_aura.cc: namespace views { -aura::client::WindowType GetAuraWindowTypeForWidgetType( +ui::wm::WindowType GetAuraWindowTypeForWidgetType( Widget::InitParams::Type type); } // namespace views diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index cb4af522b01eb..4196da64d6acf 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc @@ -1119,13 +1119,13 @@ class DesktopAuraTopLevelWindowTest widget_.Init(init_params); owned_window_ = new aura::Window(&child_window_delegate_); - owned_window_->SetType(aura::client::WINDOW_TYPE_NORMAL); + owned_window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); owned_window_->SetName("TestTopLevelWindow"); if (fullscreen) { owned_window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); } else { - owned_window_->SetType(aura::client::WINDOW_TYPE_MENU); + owned_window_->SetType(ui::wm::WINDOW_TYPE_MENU); } owned_window_->Init(ui::LAYER_TEXTURED); aura::client::ParentWindowWithContext( diff --git a/ui/aura/client/window_types.h b/ui/wm/public/window_types.h similarity index 63% rename from ui/aura/client/window_types.h rename to ui/wm/public/window_types.h index f0a7b777a8f1c..8a9f8b9f6b2be 100644 --- a/ui/aura/client/window_types.h +++ b/ui/wm/public/window_types.h @@ -1,16 +1,15 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 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 UI_AURA_WINDOW_TYPES_H_ -#define UI_AURA_WINDOW_TYPES_H_ +#ifndef UI_WM_PUBLIC_WINDOW_TYPES_H_ +#define UI_WM_PUBLIC_WINDOW_TYPES_H_ -namespace aura { -namespace client { +namespace ui { +namespace wm { // This isn't a property because it can't change after the window has been -// initialized. It's in client because the Aura Client application derives -// meaning from these values, not Aura itself. +// initialized. enum WindowType { WINDOW_TYPE_UNKNOWN = 0, @@ -27,10 +26,11 @@ enum WindowType { WINDOW_TYPE_PANEL, WINDOW_TYPE_MENU, + WINDOW_TYPE_TOOLTIP, }; -} // namespace client -} // namespace aura +} // namespace wm +} // namespace ui -#endif // UI_AURA_WINDOW_TYPES_H_ +#endif // UI_WM_PUBLIC_WINDOW_TYPES_H_ diff --git a/ui/wm/wm.gyp b/ui/wm/wm.gyp index 4a681c11fbba8..50635510113ca 100644 --- a/ui/wm/wm.gyp +++ b/ui/wm/wm.gyp @@ -7,6 +7,13 @@ 'chromium_code': 1, }, 'targets': [ + { + 'target_name': 'wm_public', + 'type': 'static_library', + 'sources': [ + 'public/window_types.h', + ], + }, { 'target_name': 'wm_test_support', 'type': 'static_library',