summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-19 01:50:05 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-19 01:50:05 +0000
commit5b251f10c00377eb437bf11d52128ff7f359a5e3 (patch)
tree56695914261a7a2d9ad8e8934080551c8db90452 /ui
parent8eb21c922f41dd850ea71e7fb391e50f7b4a9f5f (diff)
downloadchromium_src-5b251f10c00377eb437bf11d52128ff7f359a5e3.zip
chromium_src-5b251f10c00377eb437bf11d52128ff7f359a5e3.tar.gz
chromium_src-5b251f10c00377eb437bf11d52128ff7f359a5e3.tar.bz2
wm: public window_types.
Patch manually generated by: $ git grep -l aura::client::WINDOW_TYPE | xargs sed -i -e 's/aura::client::WINDOW_TYPE/ui::wm::WINDOW_TYPE/g' $ git commit -a -m. $ git clang-format HEAD^ --style=Chromium $ git commit -a -m. * Move window_types.h header from ui/aura/client/ to ui/wm/public/ BUG=319638 TEST=ash_unittests, aura_unittests, views_unittests, unit_tests R=ben@chromium.org Review URL: https://codereview.chromium.org/115153002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241752 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/DEPS1
-rw-r--r--ui/aura/aura.gyp1
-rw-r--r--ui/aura/test/aura_test_base.cc2
-rw-r--r--ui/aura/test/test_windows.cc8
-rw-r--r--ui/aura/test/test_windows.h6
-rw-r--r--ui/aura/window.cc4
-rw-r--r--ui/aura/window.h8
-rw-r--r--ui/oak/oak_aura_window_display.cc14
-rw-r--r--ui/views/DEPS3
-rw-r--r--ui/views/corewm/shadow_controller.cc12
-rw-r--r--ui/views/corewm/shadow_controller_unittest.cc16
-rw-r--r--ui/views/corewm/tooltip_controller_unittest.cc7
-rw-r--r--ui/views/corewm/visibility_controller.cc4
-rw-r--r--ui/views/corewm/visibility_controller_unittest.cc10
-rw-r--r--ui/views/corewm/window_animations.cc10
-rw-r--r--ui/views/widget/desktop_aura/desktop_native_widget_aura.cc2
-rw-r--r--ui/views/widget/desktop_aura/desktop_root_window_host_win.cc2
-rw-r--r--ui/views/widget/desktop_aura/desktop_screen_position_client.cc4
-rw-r--r--ui/views/widget/native_widget_aura.cc4
-rw-r--r--ui/views/widget/widget_aura_utils.cc16
-rw-r--r--ui/views/widget/widget_aura_utils.h4
-rw-r--r--ui/views/widget/widget_unittest.cc4
-rw-r--r--ui/wm/public/window_types.h (renamed from ui/aura/client/window_types.h)20
-rw-r--r--ui/wm/wm.gyp7
24 files changed, 87 insertions, 82 deletions
diff --git a/ui/aura/DEPS b/ui/aura/DEPS
index c252218..6ee093b 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 928501a..bc7b980 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 8393766..4522c98 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 8f1c21d..48ee575 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 e99fa62..ef6a2f0 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 4836a15..404ad15 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 d69d88e..6b65be4 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 e751a33..c78d0cd 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 4291fb9..a74bffc 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 49307d8..eb09616 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 4140f7d..3d32d6a 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<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);
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<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);
ParentWindow(window.get());
window->Show();
@@ -120,7 +120,7 @@ TEST_F(ShadowControllerTest, ShadowStyle) {
ShadowController::TestApi api(shadow_controller());
scoped_ptr<aura::Window> 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<aura::Window> 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<aura::Window> 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<aura::Window> 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<aura::Window> 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<aura::Window> 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 f01ef9c..8407661 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 4542f41..c34f4f3 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 222d7af..1cf90aa 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<aura::Window> animatable(
- aura::test::CreateTestWindowWithDelegate(
- &d, -2, gfx::Rect(0, 0, 50, 50), root_window()));
+ scoped_ptr<aura::Window> animatable(aura::test::CreateTestWindowWithDelegate(
+ &d, -2, gfx::Rect(0, 0, 50, 50), root_window()));
scoped_ptr<aura::Window> 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 736f4bb..d5d4da7 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 4db5a00..e95e67e 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 de0ae61..76733d0 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 a16b24b..9041799 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 d395fa7..1f97ac1 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 348f828..be284a8 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 8f0bfcc..4b16de4 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 cb4af52..4196da6 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
index f0a7b77..8a9f8b9 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 4a681c1..5063551 100644
--- a/ui/wm/wm.gyp
+++ b/ui/wm/wm.gyp
@@ -8,6 +8,13 @@
},
'targets': [
{
+ 'target_name': 'wm_public',
+ 'type': 'static_library',
+ 'sources': [
+ 'public/window_types.h',
+ ],
+ },
+ {
'target_name': 'wm_test_support',
'type': 'static_library',
'dependencies': [