diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-31 20:43:19 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-31 20:43:19 +0000 |
commit | 328fdc0fd213c30dc9b5eaac284f5627590dcfab (patch) | |
tree | 7407a8009e98693cc031099fae4df4a450141068 /ui/aura_shell | |
parent | bba4ec5d417469a6523cb39818e841ebaa8000f4 (diff) | |
download | chromium_src-328fdc0fd213c30dc9b5eaac284f5627590dcfab.zip chromium_src-328fdc0fd213c30dc9b5eaac284f5627590dcfab.tar.gz chromium_src-328fdc0fd213c30dc9b5eaac284f5627590dcfab.tar.bz2 |
aura: Add fullscreen/popups to RenderWidgetHostViewAura.
This also makes aura::DesktopHostLinux avoid generating Char
events when not appropriate, which avoids a problem that I
observed where arrow keys were moving <select> selections two
spaces instead of one.
There still appears to be an issue with the Enter key getting
double-counted in <select> popups, though (but if we avoid
sending a Char event for it, things like <textarea> break),
and fullscreen Flash windows aren't getting updated.
BUG=99757,101899,101848
TEST=manual
Review URL: http://codereview.chromium.org/8417008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura_shell')
-rw-r--r-- | ui/aura_shell/default_container_layout_manager.cc | 12 | ||||
-rw-r--r-- | ui/aura_shell/default_container_layout_manager_unittest.cc | 10 | ||||
-rw-r--r-- | ui/aura_shell/shell.cc | 18 |
3 files changed, 14 insertions, 26 deletions
diff --git a/ui/aura_shell/default_container_layout_manager.cc b/ui/aura_shell/default_container_layout_manager.cc index 5fd34bd..11a6b1b 100644 --- a/ui/aura_shell/default_container_layout_manager.cc +++ b/ui/aura_shell/default_container_layout_manager.cc @@ -100,10 +100,7 @@ void DefaultContainerLayoutManager::OnWindowResized() { } void DefaultContainerLayoutManager::OnWindowAdded(aura::Window* child) { - intptr_t type = reinterpret_cast<intptr_t>( - ui::ViewProp::GetValue(child, views::NativeWidgetAura::kWindowTypeKey)); - if (type != views::Widget::InitParams::TYPE_WINDOW || - child->transient_parent()) + if (child->type() != aura::WINDOW_TYPE_NORMAL || child->transient_parent()) return; AutoReset<bool> reset(&ignore_calculate_bounds_, true); @@ -142,10 +139,9 @@ void DefaultContainerLayoutManager::OnChildWindowVisibilityChanged( void DefaultContainerLayoutManager::CalculateBoundsForChild( aura::Window* child, gfx::Rect* requested_bounds) { - intptr_t type = reinterpret_cast<intptr_t>( - ui::ViewProp::GetValue(child, views::NativeWidgetAura::kWindowTypeKey)); - if (type != views::Widget::InitParams::TYPE_WINDOW || - ignore_calculate_bounds_ || child->transient_parent()) + if (child->type() != aura::WINDOW_TYPE_NORMAL || + ignore_calculate_bounds_ || + child->transient_parent()) return; // If a drag window is requesting bounds, make sure its attached to diff --git a/ui/aura_shell/default_container_layout_manager_unittest.cc b/ui/aura_shell/default_container_layout_manager_unittest.cc index d3dcd05..ca9d11e 100644 --- a/ui/aura_shell/default_container_layout_manager_unittest.cc +++ b/ui/aura_shell/default_container_layout_manager_unittest.cc @@ -41,11 +41,8 @@ class DefaultContainerLayoutManagerTest : public aura::test::AuraTestBase { aura::Window* CreateTestWindowWithType(const gfx::Rect& bounds, aura::Window* parent, - Widget::InitParams::Type type) { + aura::WindowType type) { aura::Window* window = new aura::Window(NULL); - props_.push_back(new ui::ViewProp( - window, views::NativeWidgetAura::kWindowTypeKey, - reinterpret_cast<void*>(type))); window->SetType(type); window->Init(ui::Layer::LAYER_HAS_NO_TEXTURE); window->SetBounds(bounds); @@ -58,7 +55,7 @@ class DefaultContainerLayoutManagerTest : public aura::test::AuraTestBase { aura::Window* parent) { return CreateTestWindowWithType(bounds, parent, - Widget::InitParams::TYPE_WINDOW); + aura::WINDOW_TYPE_NORMAL); } aura::Window* container() { return container_.get(); } @@ -69,7 +66,6 @@ class DefaultContainerLayoutManagerTest : public aura::test::AuraTestBase { protected: scoped_ptr<aura::Window> container_; - ScopedVector<ui::ViewProp> props_; scoped_ptr<aura_shell::internal::WorkspaceController> workspace_controller_; private: @@ -124,7 +120,7 @@ TEST_F(DefaultContainerLayoutManagerTest, Popup) { scoped_ptr<aura::Window> popup( CreateTestWindowWithType(gfx::Rect(0, -1000, 100, 100), container(), - Widget::InitParams::TYPE_POPUP)); + aura::WINDOW_TYPE_POPUP)); // A popup window can be placed outside of draggable area. EXPECT_EQ("0,-1000 100x100", popup->bounds().ToString()); diff --git a/ui/aura_shell/shell.cc b/ui/aura_shell/shell.cc index b0fe260..872ea61 100644 --- a/ui/aura_shell/shell.cc +++ b/ui/aura_shell/shell.cc @@ -155,22 +155,18 @@ void Shell::ToggleOverview() { void Shell::AddChildToDefaultParent(aura::Window* window) { aura::Window* parent = NULL; - intptr_t type = reinterpret_cast<intptr_t>( - ui::ViewProp::GetValue(window, views::NativeWidgetAura::kWindowTypeKey)); - switch (static_cast<Widget::InitParams::Type>(type)) { - case Widget::InitParams::TYPE_WINDOW: - case Widget::InitParams::TYPE_WINDOW_FRAMELESS: - case Widget::InitParams::TYPE_CONTROL: - case Widget::InitParams::TYPE_BUBBLE: - case Widget::InitParams::TYPE_POPUP: + switch (window->type()) { + case aura::WINDOW_TYPE_NORMAL: + case aura::WINDOW_TYPE_POPUP: parent = GetContainer(internal::kShellWindowId_DefaultContainer); break; - case Widget::InitParams::TYPE_MENU: - case Widget::InitParams::TYPE_TOOLTIP: + case aura::WINDOW_TYPE_MENU: + case aura::WINDOW_TYPE_TOOLTIP: parent = GetContainer(internal::kShellWindowId_MenusAndTooltipsContainer); break; default: - // This will crash for controls, since they can't be parented to anything. + NOTREACHED() << "Window " << window->id() + << " has unhandled type " << window->type(); break; } parent->AddChild(window); |