diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 19:56:14 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 19:56:14 +0000 |
commit | e319c7ec34024b7c06ee300303b6927063f255f7 (patch) | |
tree | 1778920d6f5299c325df18b8c278f6618db172a6 /ui | |
parent | 0706341097163814a7bacf89aec118ebfd5ba69c (diff) | |
download | chromium_src-e319c7ec34024b7c06ee300303b6927063f255f7.zip chromium_src-e319c7ec34024b7c06ee300303b6927063f255f7.tar.gz chromium_src-e319c7ec34024b7c06ee300303b6927063f255f7.tar.bz2 |
Move wm/core to wm namespace.
Also sets up new targets for wm_core, wm_core_unittests, etc.
R=sky@chromium.org
TBR=sky@chromium.org
BUG=
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256680
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256839
Review URL: https://codereview.chromium.org/196063002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257183 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
93 files changed, 417 insertions, 428 deletions
diff --git a/ui/app_list/app_list.gyp b/ui/app_list/app_list.gyp index c9a21b5..6340b7b 100644 --- a/ui/app_list/app_list.gyp +++ b/ui/app_list/app_list.gyp @@ -149,7 +149,7 @@ '../events/events.gyp:events', '../views/controls/webview/webview.gyp:webview', '../views/views.gyp:views', - '../wm/wm.gyp:wm_public', + '../wm/wm.gyp:wm_core', ], }, { # toolkit_views==0 'sources/': [ diff --git a/ui/keyboard/keyboard.gyp b/ui/keyboard/keyboard.gyp index ae05d8a..fd093fc 100644 --- a/ui/keyboard/keyboard.gyp +++ b/ui/keyboard/keyboard.gyp @@ -48,7 +48,7 @@ '../events/events.gyp:events', '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', - '../wm/wm.gyp:wm_public', + '../wm/wm.gyp:wm_core', 'keyboard_resources', ], 'defines': [ diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc index 2ec05fd..6014bff 100644 --- a/ui/keyboard/keyboard_controller.cc +++ b/ui/keyboard/keyboard_controller.cc @@ -23,7 +23,7 @@ #include "ui/keyboard/keyboard_controller_proxy.h" #include "ui/keyboard/keyboard_switches.h" #include "ui/keyboard/keyboard_util.h" -#include "ui/wm/public/masked_window_targeter.h" +#include "ui/wm/core/masked_window_targeter.h" #if defined(OS_CHROMEOS) #include "base/process/launch.h" diff --git a/ui/views/bubble/bubble_window_targeter.h b/ui/views/bubble/bubble_window_targeter.h index 09a96c7..45b1d5c 100644 --- a/ui/views/bubble/bubble_window_targeter.h +++ b/ui/views/bubble/bubble_window_targeter.h @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "ui/views/views_export.h" -#include "ui/wm/public/masked_window_targeter.h" +#include "ui/wm/core/masked_window_targeter.h" namespace aura { class Window; diff --git a/ui/views/controls/menu/menu_host.cc b/ui/views/controls/menu/menu_host.cc index e7f6fad..5e8593b 100644 --- a/ui/views/controls/menu/menu_host.cc +++ b/ui/views/controls/menu/menu_host.cc @@ -55,7 +55,7 @@ void MenuHost::InitMenuHost(Widget* parent, Init(params); if (bubble_border) - SetShadowType(GetNativeView(), views::corewm::SHADOW_TYPE_NONE); + SetShadowType(GetNativeView(), wm::SHADOW_TYPE_NONE); SetContentsView(contents_view); if (bubble_border || rounded_border) diff --git a/ui/views/corewm/capture_controller_unittest.cc b/ui/views/corewm/capture_controller_unittest.cc index e9fb667..ffece4a 100644 --- a/ui/views/corewm/capture_controller_unittest.cc +++ b/ui/views/corewm/capture_controller_unittest.cc @@ -32,14 +32,14 @@ class CaptureControllerTest : public aura::test::AuraTestBase { virtual void SetUp() OVERRIDE { AuraTestBase::SetUp(); - capture_controller_.reset(new corewm::ScopedCaptureClient(root_window())); + capture_controller_.reset(new wm::ScopedCaptureClient(root_window())); second_host_.reset(aura::WindowTreeHost::Create(gfx::Rect(0, 0, 800, 600))); second_host_->InitHost(); second_host_->window()->Show(); second_host_->SetBounds(gfx::Rect(800, 600)); second_capture_controller_.reset( - new corewm::ScopedCaptureClient(second_host_->window())); + new wm::ScopedCaptureClient(second_host_->window())); #if !defined(OS_CHROMEOS) desktop_position_client_.reset( @@ -77,9 +77,9 @@ class CaptureControllerTest : public aura::test::AuraTestBase { return second_capture_controller_->capture_client()->GetCaptureWindow(); } - scoped_ptr<corewm::ScopedCaptureClient> capture_controller_; + scoped_ptr<wm::ScopedCaptureClient> capture_controller_; scoped_ptr<aura::WindowTreeHost> second_host_; - scoped_ptr<corewm::ScopedCaptureClient> second_capture_controller_; + scoped_ptr<wm::ScopedCaptureClient> second_capture_controller_; #if !defined(OS_CHROMEOS) scoped_ptr<aura::client::ScreenPositionClient> desktop_position_client_; scoped_ptr<aura::client::ScreenPositionClient> diff --git a/ui/views/corewm/desktop_capture_controller_unittest.cc b/ui/views/corewm/desktop_capture_controller_unittest.cc index 0d42dc9..4a737b7 100644 --- a/ui/views/corewm/desktop_capture_controller_unittest.cc +++ b/ui/views/corewm/desktop_capture_controller_unittest.cc @@ -95,8 +95,8 @@ TEST_F(DesktopCaptureControllerTest, CaptureWindowInputEventTest) { scoped_ptr<Widget> widget1(new Widget()); Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP); - scoped_ptr<corewm::ScopedCaptureClient> scoped_capture_client( - new corewm::ScopedCaptureClient(params.context->GetRootWindow())); + scoped_ptr<wm::ScopedCaptureClient> scoped_capture_client( + new wm::ScopedCaptureClient(params.context->GetRootWindow())); aura::client::CaptureClient* capture_client = scoped_capture_client->capture_client(); params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc index 772ba33..39cab8e 100644 --- a/ui/views/corewm/tooltip_controller_unittest.cc +++ b/ui/views/corewm/tooltip_controller_unittest.cc @@ -76,7 +76,7 @@ class TooltipControllerTest : public aura::test::AuraTestBase { virtual ~TooltipControllerTest() {} virtual void SetUp() OVERRIDE { - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); aura::test::AuraTestBase::SetUp(); #if defined(OS_CHROMEOS) controller_.reset(new TooltipController( @@ -137,7 +137,7 @@ class TooltipControllerTest : public aura::test::AuraTestBase { ui::ScopedOleInitializer ole_initializer_; #endif - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; DISALLOW_COPY_AND_ASSIGN(TooltipControllerTest); }; @@ -695,10 +695,10 @@ class TooltipControllerTest2 : public aura::test::AuraTestBase { virtual ~TooltipControllerTest2() {} virtual void SetUp() OVERRIDE { - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); aura::test::AuraTestBase::SetUp(); controller_.reset(new TooltipController( - scoped_ptr<views::corewm::Tooltip>(test_tooltip_))); + scoped_ptr<corewm::Tooltip>(test_tooltip_))); root_window()->AddPreTargetHandler(controller_.get()); SetTooltipClient(root_window(), controller_.get()); helper_.reset(new TooltipControllerTestHelper(controller_.get())); @@ -723,7 +723,7 @@ class TooltipControllerTest2 : public aura::test::AuraTestBase { private: scoped_ptr<TooltipController> controller_; - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; DISALLOW_COPY_AND_ASSIGN(TooltipControllerTest2); }; diff --git a/ui/views/examples/content_client/examples_browser_main_parts.cc b/ui/views/examples/content_client/examples_browser_main_parts.cc index ac966c4..9e9cecb 100644 --- a/ui/views/examples/content_client/examples_browser_main_parts.cc +++ b/ui/views/examples/content_client/examples_browser_main_parts.cc @@ -41,7 +41,7 @@ ExamplesBrowserMainParts::~ExamplesBrowserMainParts() { } void ExamplesBrowserMainParts::ToolkitInitialized() { - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); } void ExamplesBrowserMainParts::PreMainMessageLoopRun() { diff --git a/ui/views/examples/content_client/examples_browser_main_parts.h b/ui/views/examples/content_client/examples_browser_main_parts.h index 65d7431..85ec1c6 100644 --- a/ui/views/examples/content_client/examples_browser_main_parts.h +++ b/ui/views/examples/content_client/examples_browser_main_parts.h @@ -15,16 +15,13 @@ struct MainFunctionParams; } namespace wm { +class WMState; class WMTestHelper; } namespace views { class ViewsDelegate; -namespace corewm { -class WMState; -} - namespace examples { class ExamplesBrowserMainParts : public content::BrowserMainParts { @@ -53,7 +50,7 @@ class ExamplesBrowserMainParts : public content::BrowserMainParts { scoped_ptr<wm::WMTestHelper> wm_test_helper_; #endif - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; DISALLOW_COPY_AND_ASSIGN(ExamplesBrowserMainParts); }; diff --git a/ui/views/examples/examples_main.cc b/ui/views/examples/examples_main.cc index 8afdd2f..9e028f0 100644 --- a/ui/views/examples/examples_main.cc +++ b/ui/views/examples/examples_main.cc @@ -71,7 +71,7 @@ int main(int argc, char** argv) { { views::DesktopTestViewsDelegate views_delegate; - views::corewm::WMState wm_state; + wm::WMState wm_state; #if !defined(OS_CHROMEOS) scoped_ptr<gfx::Screen> desktop_screen(views::CreateDesktopScreen()); diff --git a/ui/views/test/child_modal_window.cc b/ui/views/test/child_modal_window.cc index c5d40ad..2292fd6 100644 --- a/ui/views/test/child_modal_window.cc +++ b/ui/views/test/child_modal_window.cc @@ -150,7 +150,7 @@ gfx::NativeWindow ChildModalParent::GetChild() const { Widget* ChildModalParent::CreateChild() { Widget* child = Widget::CreateWindowWithParent( new ChildModalWindow, GetWidget()->GetNativeView()); - corewm::SetModalParent(child->GetNativeView(), GetModalParent()); + wm::SetModalParent(child->GetNativeView(), GetModalParent()); child->AddObserver(this); child->GetNativeView()->SetName("ChildModalWindow"); return child; diff --git a/ui/views/test/test_views_delegate.cc b/ui/views/test/test_views_delegate.cc index 6caae1d..47c1d66 100644 --- a/ui/views/test/test_views_delegate.cc +++ b/ui/views/test/test_views_delegate.cc @@ -20,7 +20,7 @@ TestViewsDelegate::TestViewsDelegate() : use_transparent_windows_(false) { DCHECK(!ViewsDelegate::views_delegate); ViewsDelegate::views_delegate = this; - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); } TestViewsDelegate::~TestViewsDelegate() { diff --git a/ui/views/test/test_views_delegate.h b/ui/views/test/test_views_delegate.h index deaab99..3642160 100644 --- a/ui/views/test/test_views_delegate.h +++ b/ui/views/test/test_views_delegate.h @@ -16,14 +16,14 @@ namespace ui { class Clipboard; } +namespace wm { +class WMState; +} + namespace views { class View; class Widget; -namespace corewm { -class WMState; -} - class TestViewsDelegate : public ViewsDelegate { public: TestViewsDelegate(); @@ -76,7 +76,7 @@ class TestViewsDelegate : public ViewsDelegate { private: bool use_transparent_windows_; - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate); }; diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc index 7929f9a..4bf036c 100644 --- a/ui/views/test/views_test_base.cc +++ b/ui/views/test/views_test_base.cc @@ -25,7 +25,7 @@ ViewsTestBase::~ViewsTestBase() { CHECK(setup_called_) << "You have overridden SetUp but never called super class's SetUp"; CHECK(teardown_called_) - << "You have overrideen TearDown but never called super class's TearDown"; + << "You have overridden TearDown but never called super class's TearDown"; } void ViewsTestBase::SetUp() { @@ -39,7 +39,7 @@ void ViewsTestBase::SetUp() { aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); aura_test_helper_->SetUp(); - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new ::wm::WMState); ui::InitializeInputMethodForTesting(); } @@ -56,7 +56,7 @@ void ViewsTestBase::TearDown() { aura_test_helper_->TearDown(); ui::TerminateContextFactoryForTests(); wm_state_.reset(); - CHECK(!corewm::ScopedCaptureClient::IsActive()); + CHECK(!wm::ScopedCaptureClient::IsActive()); } void ViewsTestBase::RunPendingMessages() { diff --git a/ui/views/test/views_test_base.h b/ui/views/test/views_test_base.h index dd08f4a..1e7c8df 100644 --- a/ui/views/test/views_test_base.h +++ b/ui/views/test/views_test_base.h @@ -14,10 +14,6 @@ #include "ui/base/win/scoped_ole_initializer.h" #endif -namespace ui { -class EventProcessor; -} - namespace aura { class WindowTreeHost; namespace test { @@ -25,6 +21,15 @@ class AuraTestHelper; } } +namespace ui { +class EventProcessor; +} + +namespace wm { +class WMState; +} + + namespace views { // A base class for views unit test. It creates a message loop necessary @@ -64,7 +69,7 @@ class ViewsTestBase : public testing::Test { base::MessageLoopForUI message_loop_; scoped_ptr<TestViewsDelegate> views_delegate_; scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; bool setup_called_; bool teardown_called_; diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc index 9796c77..9289f30 100644 --- a/ui/views/touchui/touch_selection_controller_impl.cc +++ b/ui/views/touchui/touch_selection_controller_impl.cc @@ -16,9 +16,9 @@ #include "ui/gfx/screen.h" #include "ui/gfx/size.h" #include "ui/views/widget/widget.h" +#include "ui/wm/core/masked_window_targeter.h" #include "ui/wm/core/shadow_types.h" #include "ui/wm/core/window_animations.h" -#include "ui/wm/public/masked_window_targeter.h" namespace { @@ -72,7 +72,7 @@ views::Widget* CreateTouchSelectionPopupWidget( params.context = context; params.delegate = widget_delegate; widget->Init(params); - SetShadowType(widget->GetNativeView(), views::corewm::SHADOW_TYPE_NONE); + SetShadowType(widget->GetNativeView(), wm::SHADOW_TYPE_NONE); return widget; } @@ -233,7 +233,7 @@ class TouchSelectionControllerImpl::EditingHandleView void SetWidgetVisible(bool visible, bool quick) { if (widget_->IsVisible() == visible) return; - corewm::SetWindowVisibilityAnimationDuration( + wm::SetWindowVisibilityAnimationDuration( widget_->GetNativeView(), base::TimeDelta::FromMilliseconds( quick ? kSelectionHandleQuickFadeDurationMs : 0)); diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc index bd3b291..60a7cb6 100644 --- a/ui/views/view_unittest.cc +++ b/ui/views/view_unittest.cc @@ -3679,7 +3679,7 @@ TEST_F(ViewTest, RecreateLayers) { { scoped_ptr<ui::LayerTreeOwner> cloned_owner( - corewm::RecreateLayers(w1->GetNativeView())); + wm::RecreateLayers(w1->GetNativeView())); w1_layer = cloned_owner->root(); // The order of the layers returned by RecreateWindowLayers() should match diff --git a/ui/views/views.gyp b/ui/views/views.gyp index 069633c..9b010e7 100644 --- a/ui/views/views.gyp +++ b/ui/views/views.gyp @@ -36,7 +36,7 @@ '../gfx/gfx.gyp:gfx_geometry', '../native_theme/native_theme.gyp:native_theme', '../resources/ui_resources.gyp:ui_resources', - '../wm/wm.gyp:wm_public', + '../wm/wm.gyp:wm_core', ], 'export_dependent_settings': [ '../accessibility/accessibility.gyp:ax_gen', @@ -417,49 +417,6 @@ 'window/window_resources.h', 'window/window_shape.cc', 'window/window_shape.h', - '../wm/core/base_focus_rules.cc', - '../wm/core/base_focus_rules.h', - '../wm/core/capture_controller.cc', - '../wm/core/capture_controller.h', - '../wm/core/compound_event_filter.cc', - '../wm/core/compound_event_filter.h', - '../wm/core/cursor_manager.cc', - '../wm/core/cursor_manager.h', - '../wm/core/focus_controller.cc', - '../wm/core/focus_controller.h', - '../wm/core/focus_rules.h', - '../wm/core/image_grid.cc', - '../wm/core/image_grid.h', - '../wm/core/input_method_event_filter.cc', - '../wm/core/input_method_event_filter.h', - '../wm/core/native_cursor_manager.h', - '../wm/core/native_cursor_manager_delegate.h', - '../wm/core/shadow.cc', - '../wm/core/shadow.h', - '../wm/core/shadow_controller.cc', - '../wm/core/shadow_controller.h', - '../wm/core/shadow_types.cc', - '../wm/core/shadow_types.h', - '../wm/core/transient_window_controller.cc', - '../wm/core/transient_window_controller.h', - '../wm/core/transient_window_manager.cc', - '../wm/core/transient_window_manager.h', - '../wm/core/transient_window_observer.h', - '../wm/core/transient_window_stacking_client.cc', - '../wm/core/transient_window_stacking_client.h', - '../wm/core/visibility_controller.cc', - '../wm/core/visibility_controller.h', - '../wm/core/window_animations.cc', - '../wm/core/window_animations.h', - '../wm/core/window_modality_controller.cc', - '../wm/core/window_modality_controller.h', - '../wm/core/window_util.cc', - '../wm/core/window_util.h', - '../wm/core/wm_core_export.h', - '../wm/core/wm_core_switches.cc', - '../wm/core/wm_core_switches.h', - '../wm/core/wm_state.cc', - '../wm/core/wm_state.h', ], 'include_dirs': [ '../../third_party/wtl/include', @@ -553,6 +510,7 @@ '../events/events.gyp:events', '../gfx/gfx.gyp:gfx', '../gfx/gfx.gyp:gfx_geometry', + '../wm/wm.gyp:wm_core', 'views', ], 'include_dirs': [ @@ -644,7 +602,7 @@ '../resources/ui_resources.gyp:ui_resources', '../resources/ui_resources.gyp:ui_test_pak', '../ui_unittests.gyp:ui_test_support', - '../wm/wm.gyp:wm_public', + '../wm/wm.gyp:wm_core', 'views', 'views_test_support', ], @@ -710,16 +668,6 @@ 'widget/window_reorderer_unittest.cc', 'window/dialog_client_view_unittest.cc', 'window/dialog_delegate_unittest.cc', - '../wm/core/compound_event_filter_unittest.cc', - '../wm/core/cursor_manager_unittest.cc', - '../wm/core/focus_controller_unittest.cc', - '../wm/core/input_method_event_filter_unittest.cc', - '../wm/core/image_grid_unittest.cc', - '../wm/core/shadow_controller_unittest.cc', - '../wm/core/transient_window_manager_unittest.cc', - '../wm/core/transient_window_stacking_client_unittest.cc', - '../wm/core/visibility_controller_unittest.cc', - '../wm/core/window_animations_unittest.cc', ], 'conditions': [ ['chromeos==0', { diff --git a/ui/views/widget/desktop_aura/desktop_focus_rules.cc b/ui/views/widget/desktop_aura/desktop_focus_rules.cc index 16f71c5..1d7d40c 100644 --- a/ui/views/widget/desktop_aura/desktop_focus_rules.cc +++ b/ui/views/widget/desktop_aura/desktop_focus_rules.cc @@ -40,7 +40,7 @@ bool DesktopFocusRules::IsWindowConsideredVisibleForActivation( aura::Window* DesktopFocusRules::GetToplevelWindow( aura::Window* window) const { aura::Window* top_level_window = - corewm::BaseFocusRules::GetToplevelWindow(window); + wm::BaseFocusRules::GetToplevelWindow(window); // In Desktop-Aura, only the content_window or children of the RootWindow are // considered as top level windows. if (top_level_window == content_window_->parent()) @@ -51,7 +51,7 @@ aura::Window* DesktopFocusRules::GetToplevelWindow( aura::Window* DesktopFocusRules::GetNextActivatableWindow( aura::Window* window) const { aura::Window* next_activatable_window = - corewm::BaseFocusRules::GetNextActivatableWindow(window); + wm::BaseFocusRules::GetNextActivatableWindow(window); // In Desktop-Aura the content_window_'s parent is a dummy window and thus // should never be activated. We should return the content_window_ if it // can be activated in this case. diff --git a/ui/views/widget/desktop_aura/desktop_focus_rules.h b/ui/views/widget/desktop_aura/desktop_focus_rules.h index ef913fa..e096e80 100644 --- a/ui/views/widget/desktop_aura/desktop_focus_rules.h +++ b/ui/views/widget/desktop_aura/desktop_focus_rules.h @@ -9,13 +9,13 @@ namespace views { -class DesktopFocusRules : public corewm::BaseFocusRules { +class DesktopFocusRules : public wm::BaseFocusRules { public: explicit DesktopFocusRules(aura::Window* content_window); virtual ~DesktopFocusRules(); private: - // Overridden from corewm::BaseFocusRules: + // Overridden from wm::BaseFocusRules: virtual bool CanActivateWindow(aura::Window* window) const OVERRIDE; virtual bool SupportsChildActivation(aura::Window* window) const OVERRIDE; virtual bool IsWindowConsideredVisibleForActivation( diff --git a/ui/views/widget/desktop_aura/desktop_focus_rules_unittest.cc b/ui/views/widget/desktop_aura/desktop_focus_rules_unittest.cc index c654503..39eda7d 100644 --- a/ui/views/widget/desktop_aura/desktop_focus_rules_unittest.cc +++ b/ui/views/widget/desktop_aura/desktop_focus_rules_unittest.cc @@ -45,12 +45,12 @@ TEST_F(DesktopFocusRulesTest, DontFocusWindowsInOtherHierarchies) { aura::Window* w2_child = new aura::Window(&w2_child_delegate); w2_child->Init(aura::WINDOW_LAYER_SOLID_COLOR); w2->GetNativeView()->AddChild(w2_child); - views::corewm::AddTransientChild(w1->GetNativeView(), w2_child); + wm::AddTransientChild(w1->GetNativeView(), w2_child); aura::client::GetFocusClient(w2->GetNativeView())->FocusWindow(w2_child); aura::Window* focused = aura::client::GetFocusClient(w2->GetNativeView())->GetFocusedWindow(); EXPECT_TRUE((focused == NULL) || w2->GetNativeView()->Contains(focused)); - views::corewm::RemoveTransientChild(w1->GetNativeView(), w2_child); + wm::RemoveTransientChild(w1->GetNativeView(), w2_child); w1.reset(); w2.reset(); } diff --git a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc index 3d7f7f1..8225e00 100644 --- a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc +++ b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc @@ -38,7 +38,7 @@ void DesktopNativeCursorManager::RemoveHost(aura::WindowTreeHost* host) { void DesktopNativeCursorManager::SetDisplay( const gfx::Display& display, - views::corewm::NativeCursorManagerDelegate* delegate) { + wm::NativeCursorManagerDelegate* delegate) { cursor_loader_->UnloadAll(); cursor_loader_->set_display(display); @@ -50,7 +50,7 @@ void DesktopNativeCursorManager::SetDisplay( void DesktopNativeCursorManager::SetCursor( gfx::NativeCursor cursor, - views::corewm::NativeCursorManagerDelegate* delegate) { + wm::NativeCursorManagerDelegate* delegate) { gfx::NativeCursor new_cursor = cursor; cursor_loader_->SetPlatformCursor(&new_cursor); delegate->CommitCursor(new_cursor); @@ -63,7 +63,7 @@ void DesktopNativeCursorManager::SetCursor( void DesktopNativeCursorManager::SetVisibility( bool visible, - views::corewm::NativeCursorManagerDelegate* delegate) { + wm::NativeCursorManagerDelegate* delegate) { delegate->CommitVisibility(visible); if (visible) { @@ -81,19 +81,19 @@ void DesktopNativeCursorManager::SetVisibility( void DesktopNativeCursorManager::SetCursorSet( ui::CursorSetType cursor_set, - views::corewm::NativeCursorManagerDelegate* delegate) { + wm::NativeCursorManagerDelegate* delegate) { NOTIMPLEMENTED(); } void DesktopNativeCursorManager::SetScale( float scale, - views::corewm::NativeCursorManagerDelegate* delegate) { + wm::NativeCursorManagerDelegate* delegate) { NOTIMPLEMENTED(); } void DesktopNativeCursorManager::SetMouseEventsEnabled( bool enabled, - views::corewm::NativeCursorManagerDelegate* delegate) { + wm::NativeCursorManagerDelegate* delegate) { delegate->CommitMouseEventsEnabled(enabled); // TODO(erg): In the ash version, we set the last mouse location on Env. I'm diff --git a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h index 1f11aad..d917af4 100644 --- a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h +++ b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.h @@ -20,18 +20,18 @@ namespace ui { class CursorLoader; } -namespace views { -class DesktopCursorLoaderUpdater; - -namespace corewm { +namespace wm { class NativeCursorManagerDelegate; } +namespace views { +class DesktopCursorLoaderUpdater; + // A NativeCursorManager that performs the desktop-specific setting of cursor // state. Similar to AshNativeCursorManager, it also communicates these changes // to all root windows. class VIEWS_EXPORT DesktopNativeCursorManager - : public views::corewm::NativeCursorManager { + : public wm::NativeCursorManager { public: DesktopNativeCursorManager( scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater); @@ -47,25 +47,25 @@ class VIEWS_EXPORT DesktopNativeCursorManager void RemoveHost(aura::WindowTreeHost* host); private: - // Overridden from views::corewm::NativeCursorManager: + // Overridden from wm::NativeCursorManager: virtual void SetDisplay( const gfx::Display& display, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; + wm::NativeCursorManagerDelegate* delegate) OVERRIDE; virtual void SetCursor( gfx::NativeCursor cursor, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; + wm::NativeCursorManagerDelegate* delegate) OVERRIDE; virtual void SetVisibility( bool visible, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; + wm::NativeCursorManagerDelegate* delegate) OVERRIDE; virtual void SetCursorSet( ui::CursorSetType cursor_set, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; + wm::NativeCursorManagerDelegate* delegate) OVERRIDE; virtual void SetScale( float scale, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; + wm::NativeCursorManagerDelegate* delegate) OVERRIDE; virtual void SetMouseEventsEnabled( bool enabled, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; + wm::NativeCursorManagerDelegate* delegate) OVERRIDE; // The set of hosts to notify of changes in cursor state. typedef std::set<aura::WindowTreeHost*> Hosts; 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 cb54b8f..bbb7215 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc @@ -243,7 +243,7 @@ class RootWindowDestructionObserver : public aura::WindowObserver { int DesktopNativeWidgetAura::cursor_reference_count_ = 0; DesktopNativeCursorManager* DesktopNativeWidgetAura::native_cursor_manager_ = NULL; -views::corewm::CursorManager* DesktopNativeWidgetAura::cursor_manager_ = NULL; +wm::CursorManager* DesktopNativeWidgetAura::cursor_manager_ = NULL; DesktopNativeWidgetAura::DesktopNativeWidgetAura( internal::NativeWidgetDelegate* delegate) @@ -401,7 +401,7 @@ void DesktopNativeWidgetAura::InitNativeWidget( } content_window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); content_window_->Init(params.layer_type); - corewm::SetShadowType(content_window_, corewm::SHADOW_TYPE_NONE); + wm::SetShadowType(content_window_, wm::SHADOW_TYPE_NONE); content_window_container_ = new aura::Window(NULL); content_window_container_->Init(aura::WINDOW_LAYER_NOT_DRAWN); @@ -428,7 +428,7 @@ void DesktopNativeWidgetAura::InitNativeWidget( // when modal windows are at the top of the Zorder. if (widget_type_ == Widget::InitParams::TYPE_WINDOW) window_modality_controller_.reset( - new views::corewm::WindowModalityController(host_->window())); + new wm::WindowModalityController(host_->window())); // |root_window_event_filter_| must be created before // OnWindowTreeHostCreated() is invoked. @@ -438,7 +438,7 @@ void DesktopNativeWidgetAura::InitNativeWidget( // handed way of accomplishing focus. // No event filter for aura::Env. Create CompoundEvnetFilter per // WindowEventDispatcher. - root_window_event_filter_ = new corewm::CompoundEventFilter; + root_window_event_filter_ = new wm::CompoundEventFilter; // Pass ownership of the filter to the root_window. host_->window()->SetEventFilter(root_window_event_filter_); @@ -450,8 +450,8 @@ void DesktopNativeWidgetAura::InitNativeWidget( DesktopCursorLoaderUpdater::Create()); } if (!cursor_manager_) { - cursor_manager_ = new views::corewm::CursorManager( - scoped_ptr<corewm::NativeCursorManager>(native_cursor_manager_)); + cursor_manager_ = new wm::CursorManager( + scoped_ptr<wm::NativeCursorManager>(native_cursor_manager_)); } native_cursor_manager_->AddHost(host()); aura::client::SetCursorClient(host_->window(), cursor_manager_); @@ -462,8 +462,8 @@ void DesktopNativeWidgetAura::InitNativeWidget( capture_client_.reset(new DesktopCaptureClient(host_->window())); - corewm::FocusController* focus_controller = - new corewm::FocusController(new DesktopFocusRules(content_window_)); + wm::FocusController* focus_controller = + new wm::FocusController(new DesktopFocusRules(content_window_)); focus_client_.reset(focus_controller); aura::client::SetFocusClient(host_->window(), focus_controller); aura::client::SetActivationClient(host_->window(), focus_controller); @@ -505,11 +505,11 @@ void DesktopNativeWidgetAura::InitNativeWidget( host_->window()->AddPreTargetHandler(tooltip_controller_.get()); if (params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW) { - visibility_controller_.reset(new views::corewm::VisibilityController); + visibility_controller_.reset(new wm::VisibilityController); aura::client::SetVisibilityClient(host_->window(), visibility_controller_.get()); - views::corewm::SetChildWindowVisibilityChangesAnimated(host_->window()); - views::corewm::SetChildWindowVisibilityChangesAnimated( + wm::SetChildWindowVisibilityChangesAnimated(host_->window()); + wm::SetChildWindowVisibilityChangesAnimated( content_window_container_); } @@ -525,7 +525,7 @@ void DesktopNativeWidgetAura::InitNativeWidget( aura::client::SetActivationDelegate(content_window_, this); - shadow_controller_.reset(new corewm::ShadowController( + shadow_controller_.reset(new wm::ShadowController( aura::client::GetActivationClient(host_->window()))); content_window_->SetProperty(aura::client::kCanMaximizeKey, @@ -1173,7 +1173,7 @@ ui::EventHandler* DesktopNativeWidgetAura::GetEventHandler() { void DesktopNativeWidgetAura::InstallInputMethodEventFilter() { DCHECK(!input_method_event_filter_.get()); - input_method_event_filter_.reset(new corewm::InputMethodEventFilter( + input_method_event_filter_.reset(new wm::InputMethodEventFilter( host_->GetAcceleratedWidget())); input_method_event_filter_->SetInputMethodPropertyInRootWindow( host_->window()); diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h index 1b2764b..05573b9 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h @@ -15,6 +15,7 @@ #include "ui/base/cursor/cursor.h" #include "ui/views/ime/input_method_delegate.h" #include "ui/views/widget/native_widget_private.h" +#include "ui/wm/core/compound_event_filter.h" namespace aura { class WindowEventDispatcher; @@ -27,19 +28,20 @@ class WindowTreeClient; } } -namespace views { - -namespace corewm { +namespace wm { class CompoundEventFilter; class CursorManager; class FocusController; class InputMethodEventFilter; class ShadowController; -class TooltipController; class VisibilityController; class WindowModalityController; } +namespace views { +namespace corewm { +class TooltipController; +} class DesktopCaptureClient; class DesktopDispatcherClient; class DesktopEventClient; @@ -77,10 +79,10 @@ class VIEWS_EXPORT DesktopNativeWidgetAura // as by the time we get here |dispatcher_| is NULL. virtual void OnDesktopWindowTreeHostDestroyed(aura::WindowTreeHost* host); - corewm::InputMethodEventFilter* input_method_event_filter() { + wm::InputMethodEventFilter* input_method_event_filter() { return input_method_event_filter_.get(); } - corewm::CompoundEventFilter* root_window_event_filter() { + wm::CompoundEventFilter* root_window_event_filter() { return root_window_event_filter_; } aura::WindowTreeHost* host() { @@ -272,7 +274,7 @@ class VIEWS_EXPORT DesktopNativeWidgetAura internal::NativeWidgetDelegate* native_widget_delegate_; - scoped_ptr<corewm::FocusController> focus_client_; + scoped_ptr<wm::FocusController> focus_client_; scoped_ptr<DesktopDispatcherClient> dispatcher_client_; scoped_ptr<aura::client::ScreenPositionClient> position_client_; scoped_ptr<aura::client::DragDropClient> drag_drop_client_; @@ -281,9 +283,9 @@ class VIEWS_EXPORT DesktopNativeWidgetAura scoped_ptr<FocusManagerEventHandler> focus_manager_event_handler_; // Toplevel event filter which dispatches to other event filters. - corewm::CompoundEventFilter* root_window_event_filter_; + wm::CompoundEventFilter* root_window_event_filter_; - scoped_ptr<corewm::InputMethodEventFilter> input_method_event_filter_; + scoped_ptr<wm::InputMethodEventFilter> input_method_event_filter_; scoped_ptr<DropHelper> drop_helper_; int last_drop_operation_; @@ -291,9 +293,9 @@ class VIEWS_EXPORT DesktopNativeWidgetAura scoped_ptr<corewm::TooltipController> tooltip_controller_; scoped_ptr<TooltipManagerAura> tooltip_manager_; - scoped_ptr<views::corewm::VisibilityController> visibility_controller_; + scoped_ptr<wm::VisibilityController> visibility_controller_; - scoped_ptr<views::corewm::WindowModalityController> + scoped_ptr<wm::WindowModalityController> window_modality_controller_; // See comments in OnLostActive(). @@ -307,10 +309,10 @@ class VIEWS_EXPORT DesktopNativeWidgetAura // (potentially) after we tear down the X11 connection because that's a // crash. static int cursor_reference_count_; - static views::corewm::CursorManager* cursor_manager_; + static wm::CursorManager* cursor_manager_; static views::DesktopNativeCursorManager* native_cursor_manager_; - scoped_ptr<corewm::ShadowController> shadow_controller_; + scoped_ptr<wm::ShadowController> shadow_controller_; // Reorders child windows of |window_| associated with a view based on the // order of the associated views in the widget's view hierarchy. diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host.h b/ui/views/widget/desktop_aura/desktop_window_tree_host.h index 2045ef8..d70f402 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host.h @@ -31,7 +31,6 @@ class NativeTheme; namespace views { namespace corewm { - class Tooltip; } diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc index d3efbeb..bbf72fe 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -160,7 +160,7 @@ void DesktopWindowTreeHostWin::OnNativeWidgetCreated( should_animate_window_close_ = content_window_->type() != ui::wm::WINDOW_TYPE_NORMAL && - !views::corewm::WindowAnimationsDisabled(content_window_); + !wm::WindowAnimationsDisabled(content_window_); // TODO this is not invoked *after* Init(), but should be ok. SetWindowTransparency(); diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index e3f1179..664321c 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc @@ -359,9 +359,9 @@ void DesktopWindowTreeHostX11::CenterWindow(const gfx::Size& size) { // If |window_|'s transient parent bounds are big enough to contain |size|, // use them instead. - if (corewm::GetTransientParent(content_window_)) { + if (wm::GetTransientParent(content_window_)) { gfx::Rect transient_parent_rect = - corewm::GetTransientParent(content_window_)->GetBoundsInScreen(); + wm::GetTransientParent(content_window_)->GetBoundsInScreen(); if (transient_parent_rect.height() >= size.height() && transient_parent_rect.width() >= size.width()) { parent_bounds = transient_parent_rect; diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index 1c4dd16..30f2aea 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -132,7 +132,7 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { // 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() != ui::wm::WINDOW_TYPE_UNKNOWN) { - corewm::AddTransientChild(parent, window_); + wm::AddTransientChild(parent, window_); if (!context) context = parent; parent = NULL; @@ -315,9 +315,9 @@ void NativeWidgetAura::CenterWindow(const gfx::Size& size) { // If |window_|'s transient parent's bounds are big enough to fit it, then we // center it with respect to the transient parent. - if (views::corewm::GetTransientParent(window_)) { + if (wm::GetTransientParent(window_)) { gfx::Rect transient_parent_rect = - views::corewm::GetTransientParent(window_)->GetBoundsInRootWindow(); + wm::GetTransientParent(window_)->GetBoundsInRootWindow(); transient_parent_rect.Intersect(work_area); if (transient_parent_rect.height() >= size.height() && transient_parent_rect.width() >= size.width()) @@ -523,7 +523,7 @@ void NativeWidgetAura::Deactivate() { } bool NativeWidgetAura::IsActive() const { - return window_ && corewm::IsActiveWindow(window_); + return window_ && wm::IsActiveWindow(window_); } void NativeWidgetAura::SetAlwaysOnTop(bool on_top) { @@ -1083,7 +1083,7 @@ void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view, void NativeWidgetPrivate::GetAllOwnedWidgets(gfx::NativeView native_view, Widget::Widgets* owned) { const aura::Window::Windows& transient_children = - views::corewm::GetTransientChildren(native_view); + wm::GetTransientChildren(native_view); for (aura::Window::Windows::const_iterator i = transient_children.begin(); i != transient_children.end(); ++i) { NativeWidgetPrivate* native_widget = static_cast<NativeWidgetPrivate*>( diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc index 627b923..5047b49 100644 --- a/ui/views/window/dialog_delegate.cc +++ b/ui/views/window/dialog_delegate.cc @@ -167,7 +167,7 @@ NonClientFrameView* DialogDelegate::CreateDialogFrameView(Widget* widget) { frame->SetTitlebarExtraView(titlebar_view); } // TODO(msw): Add a matching shadow type and remove the bubble frame border? - corewm::SetShadowType(widget->GetNativeWindow(), corewm::SHADOW_TYPE_NONE); + wm::SetShadowType(widget->GetNativeWindow(), wm::SHADOW_TYPE_NONE); return frame; } diff --git a/ui/wm/core/base_focus_rules.cc b/ui/wm/core/base_focus_rules.cc index 1092f07..bb90941 100644 --- a/ui/wm/core/base_focus_rules.cc +++ b/ui/wm/core/base_focus_rules.cc @@ -11,8 +11,7 @@ #include "ui/wm/core/window_modality_controller.h" #include "ui/wm/core/window_util.h" -namespace views { -namespace corewm { +namespace wm { namespace { aura::Window* GetFocusedWindow(aura::Window* context) { @@ -121,15 +120,15 @@ aura::Window* BaseFocusRules::GetActivatableWindow(aura::Window* window) const { if (modal_transient) return GetActivatableWindow(modal_transient); - if (views::corewm::GetTransientParent(child)) { + if (wm::GetTransientParent(child)) { // To avoid infinite recursion, if |child| has a transient parent // whose own modal transient is |child| itself, just return |child|. aura::Window* parent_modal_transient = - GetModalTransient(views::corewm::GetTransientParent(child)); + GetModalTransient(wm::GetTransientParent(child)); if (parent_modal_transient == child) return child; - return GetActivatableWindow(views::corewm::GetTransientParent(child)); + return GetActivatableWindow(wm::GetTransientParent(child)); } parent = parent->parent(); @@ -193,5 +192,4 @@ aura::Window* BaseFocusRules::GetNextActivatableWindow( return NULL; } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/base_focus_rules.h b/ui/wm/core/base_focus_rules.h index cfa0f94..7195dad 100644 --- a/ui/wm/core/base_focus_rules.h +++ b/ui/wm/core/base_focus_rules.h @@ -9,8 +9,7 @@ #include "base/compiler_specific.h" #include "ui/wm/core/focus_rules.h" -namespace views { -namespace corewm { +namespace wm { // A set of basic focus and activation rules. Specializations should most likely // subclass this and call up to these methods rather than reimplementing them. @@ -41,7 +40,6 @@ class WM_CORE_EXPORT BaseFocusRules : public FocusRules { DISALLOW_COPY_AND_ASSIGN(BaseFocusRules); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_BASE_FOCUS_RULES_H_ diff --git a/ui/wm/core/capture_controller.cc b/ui/wm/core/capture_controller.cc index 558ac3d0..cea55ba 100644 --- a/ui/wm/core/capture_controller.cc +++ b/ui/wm/core/capture_controller.cc @@ -7,8 +7,7 @@ #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" -namespace views { -namespace corewm { +namespace wm { //////////////////////////////////////////////////////////////////////////////// // CaptureController, public: @@ -142,5 +141,4 @@ void ScopedCaptureClient::Shutdown() { root_window_ = NULL; } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/capture_controller.h b/ui/wm/core/capture_controller.h index ab9afa8..a368b63 100644 --- a/ui/wm/core/capture_controller.h +++ b/ui/wm/core/capture_controller.h @@ -13,8 +13,7 @@ #include "ui/aura/window_observer.h" #include "ui/wm/core/wm_core_export.h" -namespace views { -namespace corewm { +namespace wm { // Internal CaptureClient implementation. See ScopedCaptureClient for details. class WM_CORE_EXPORT CaptureController : public aura::client::CaptureClient { @@ -82,7 +81,6 @@ class WM_CORE_EXPORT ScopedCaptureClient : public aura::WindowObserver { DISALLOW_COPY_AND_ASSIGN(ScopedCaptureClient); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_CAPTURE_CONTROLLER_H_ diff --git a/ui/wm/core/compound_event_filter.cc b/ui/wm/core/compound_event_filter.cc index a1eb7ef..f7ab7d7 100644 --- a/ui/wm/core/compound_event_filter.cc +++ b/ui/wm/core/compound_event_filter.cc @@ -21,8 +21,7 @@ #include "ui/events/x/touch_factory_x11.h" #endif -namespace views { -namespace corewm { +namespace wm { namespace { @@ -294,5 +293,4 @@ void CompoundEventFilter::OnGestureEvent(ui::GestureEvent* event) { } } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/compound_event_filter.h b/ui/wm/core/compound_event_filter.h index a12e57b..4b72673 100644 --- a/ui/wm/core/compound_event_filter.h +++ b/ui/wm/core/compound_event_filter.h @@ -25,8 +25,7 @@ class MouseEvent; class TouchEvent; } -namespace views { -namespace corewm { +namespace wm { // TODO(beng): This class should die. AddEventHandler() on the root Window // should be used instead. @@ -89,7 +88,6 @@ class WM_CORE_EXPORT CompoundEventFilter : public ui::EventHandler { DISALLOW_COPY_AND_ASSIGN(CompoundEventFilter); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_COMPOUND_EVENT_FILTER_H_ diff --git a/ui/wm/core/compound_event_filter_unittest.cc b/ui/wm/core/compound_event_filter_unittest.cc index 0c73504..a0d193e 100644 --- a/ui/wm/core/compound_event_filter_unittest.cc +++ b/ui/wm/core/compound_event_filter_unittest.cc @@ -26,8 +26,7 @@ base::TimeDelta GetTime() { } -namespace views { -namespace corewm { +namespace wm { namespace { @@ -204,5 +203,4 @@ TEST_F(CompoundEventFilterTest, DontHideWhenMouseDown) { aura::Env::GetInstance()->RemovePreTargetHandler(compound_filter.get()); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/cursor_manager.cc b/ui/wm/core/cursor_manager.cc index 9d1e2db..1a95c9f 100644 --- a/ui/wm/core/cursor_manager.cc +++ b/ui/wm/core/cursor_manager.cc @@ -9,8 +9,7 @@ #include "ui/wm/core/native_cursor_manager.h" #include "ui/wm/core/native_cursor_manager_delegate.h" -namespace views { -namespace corewm { +namespace wm { namespace internal { @@ -231,5 +230,4 @@ void CursorManager::CommitMouseEventsEnabled(bool enabled) { current_state_->SetMouseEventsEnabled(enabled); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/cursor_manager.h b/ui/wm/core/cursor_manager.h index 1f96ebd..3640c7e 100644 --- a/ui/wm/core/cursor_manager.h +++ b/ui/wm/core/cursor_manager.h @@ -20,8 +20,7 @@ namespace gfx { class Display; } -namespace views { -namespace corewm { +namespace wm { namespace internal { class CursorState; @@ -86,7 +85,6 @@ class WM_CORE_EXPORT CursorManager : public aura::client::CursorClient, DISALLOW_COPY_AND_ASSIGN(CursorManager); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_CURSOR_MANAGER_H_ diff --git a/ui/wm/core/cursor_manager_unittest.cc b/ui/wm/core/cursor_manager_unittest.cc index f9fa087..9348b9d 100644 --- a/ui/wm/core/cursor_manager_unittest.cc +++ b/ui/wm/core/cursor_manager_unittest.cc @@ -10,40 +10,40 @@ namespace { -class TestingCursorManager : public views::corewm::NativeCursorManager { +class TestingCursorManager : public wm::NativeCursorManager { public: - // Overridden from views::corewm::NativeCursorManager: + // Overridden from wm::NativeCursorManager: virtual void SetDisplay( const gfx::Display& display, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE {} + wm::NativeCursorManagerDelegate* delegate) OVERRIDE {} virtual void SetCursor( gfx::NativeCursor cursor, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE { + wm::NativeCursorManagerDelegate* delegate) OVERRIDE { delegate->CommitCursor(cursor); } virtual void SetVisibility( bool visible, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE { + wm::NativeCursorManagerDelegate* delegate) OVERRIDE { delegate->CommitVisibility(visible); } virtual void SetMouseEventsEnabled( bool enabled, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE { + wm::NativeCursorManagerDelegate* delegate) OVERRIDE { delegate->CommitMouseEventsEnabled(enabled); } virtual void SetCursorSet( ui::CursorSetType cursor_set, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE { + wm::NativeCursorManagerDelegate* delegate) OVERRIDE { delegate->CommitCursorSet(cursor_set); } virtual void SetScale( float scale, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE { + wm::NativeCursorManagerDelegate* delegate) OVERRIDE { delegate->CommitScale(scale); } }; @@ -54,12 +54,12 @@ class CursorManagerTest : public aura::test::AuraTestBase { protected: CursorManagerTest() : delegate_(new TestingCursorManager), - cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>( + cursor_manager_(scoped_ptr<wm::NativeCursorManager>( delegate_)) { } TestingCursorManager* delegate_; - views::corewm::CursorManager cursor_manager_; + wm::CursorManager cursor_manager_; }; class TestingCursorClientObserver : public aura::client::CursorClientObserver { diff --git a/ui/wm/core/easy_resize_window_targeter.cc b/ui/wm/core/easy_resize_window_targeter.cc index 5b48c81..24d5760 100644 --- a/ui/wm/core/easy_resize_window_targeter.cc +++ b/ui/wm/core/easy_resize_window_targeter.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/wm/public/easy_resize_window_targeter.h" +#include "ui/wm/core/easy_resize_window_targeter.h" #include "ui/aura/client/transient_window_client.h" #include "ui/aura/window.h" diff --git a/ui/wm/public/easy_resize_window_targeter.h b/ui/wm/core/easy_resize_window_targeter.h index f873509..fae6d46 100644 --- a/ui/wm/public/easy_resize_window_targeter.h +++ b/ui/wm/core/easy_resize_window_targeter.h @@ -2,17 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_WM_PUBLIC_EASY_RESIZE_WINDOW_TARGETER_H_ -#define UI_WM_PUBLIC_EASY_RESIZE_WINDOW_TARGETER_H_ +#ifndef UI_WM_CORE_EASY_RESIZE_WINDOW_TARGETER_H_ +#define UI_WM_CORE_EASY_RESIZE_WINDOW_TARGETER_H_ #include "ui/aura/window_targeter.h" #include "ui/gfx/geometry/insets.h" +#include "ui/wm/core/wm_core_export.h" namespace wm { // An EventTargeter for a container window that uses a slightly larger // hit-target region for easier resize. -class EasyResizeWindowTargeter : public aura::WindowTargeter { +class WM_CORE_EXPORT EasyResizeWindowTargeter : public aura::WindowTargeter { public: // |container| window is the owner of this targeter. EasyResizeWindowTargeter(aura::Window* container, @@ -49,4 +50,4 @@ class EasyResizeWindowTargeter : public aura::WindowTargeter { } // namespace wm -#endif // UI_WM_PUBLIC_EASY_RESIZE_WINDOW_TARGETER_H_ +#endif // UI_WM_CORE_EASY_RESIZE_WINDOW_TARGETER_H_ diff --git a/ui/wm/core/focus_controller.cc b/ui/wm/core/focus_controller.cc index 197e04a..c4e67cf 100644 --- a/ui/wm/core/focus_controller.cc +++ b/ui/wm/core/focus_controller.cc @@ -15,8 +15,7 @@ #include "ui/wm/core/focus_rules.h" #include "ui/wm/core/window_util.h" -namespace views { -namespace corewm { +namespace wm { namespace { // When a modal window is activated, we bring its entire transient parent chain @@ -26,10 +25,10 @@ void StackTransientParentsBelowModalWindow(aura::Window* window) { if (window->GetProperty(aura::client::kModalKey) != ui::MODAL_TYPE_WINDOW) return; - aura::Window* transient_parent = views::corewm::GetTransientParent(window); + aura::Window* transient_parent = wm::GetTransientParent(window); while (transient_parent) { transient_parent->parent()->StackChildAtTop(transient_parent); - transient_parent = views::corewm::GetTransientParent(transient_parent); + transient_parent = wm::GetTransientParent(transient_parent); } } @@ -375,5 +374,4 @@ void FocusController::WindowFocusedFromInputEvent(aura::Window* window) { FocusWindow(window); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/focus_controller.h b/ui/wm/core/focus_controller.h index 9e46ec7..aa97d4d 100644 --- a/ui/wm/core/focus_controller.h +++ b/ui/wm/core/focus_controller.h @@ -15,8 +15,7 @@ #include "ui/events/event_handler.h" #include "ui/wm/core/wm_core_export.h" -namespace views { -namespace corewm { +namespace wm { class FocusRules; @@ -124,7 +123,6 @@ class WM_CORE_EXPORT FocusController : public aura::client::ActivationClient, DISALLOW_COPY_AND_ASSIGN(FocusController); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_FOCUS_CONTROLLER_H_ diff --git a/ui/wm/core/focus_controller_unittest.cc b/ui/wm/core/focus_controller_unittest.cc index 0dd9791..aa1dac7 100644 --- a/ui/wm/core/focus_controller_unittest.cc +++ b/ui/wm/core/focus_controller_unittest.cc @@ -22,8 +22,7 @@ #include "ui/wm/core/base_focus_rules.h" #include "ui/wm/core/wm_state.h" -namespace views { -namespace corewm { +namespace wm { class FocusNotificationObserver : public aura::client::ActivationChangeObserver, public aura::client::FocusChangeObserver { @@ -348,7 +347,7 @@ class FocusControllerTestBase : public aura::test::AuraTestBase { // Overridden from aura::test::AuraTestBase: virtual void SetUp() OVERRIDE { - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); // FocusController registers itself as an Env observer so it can catch all // window initializations, including the root_window()'s, so we create it // before allowing the base setup. @@ -447,7 +446,7 @@ class FocusControllerTestBase : public aura::test::AuraTestBase { private: scoped_ptr<FocusController> focus_controller_; TestFocusRules* test_focus_rules_; - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; DISALLOW_COPY_AND_ASSIGN(FocusControllerTestBase); }; @@ -1200,5 +1199,4 @@ FOCUS_CONTROLLER_TEST(FocusControllerApiTest, // See description above DontPassDeletedWindow() for details. FOCUS_CONTROLLER_TEST(FocusControllerApiTest, DontPassDeletedWindow); -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/focus_rules.h b/ui/wm/core/focus_rules.h index 68cd7c4..79ffd74 100644 --- a/ui/wm/core/focus_rules.h +++ b/ui/wm/core/focus_rules.h @@ -11,8 +11,7 @@ namespace aura { class Window; } -namespace views { -namespace corewm { +namespace wm { // Implemented by an object that establishes the rules about what can be // focused or activated. @@ -62,7 +61,6 @@ class WM_CORE_EXPORT FocusRules { aura::Window* ignore) const = 0; }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_FOCUS_RULES_H_ diff --git a/ui/wm/core/image_grid.cc b/ui/wm/core/image_grid.cc index 4650a9f..414a2a6 100644 --- a/ui/wm/core/image_grid.cc +++ b/ui/wm/core/image_grid.cc @@ -20,8 +20,7 @@ using std::max; using std::min; -namespace views { -namespace corewm { +namespace wm { gfx::RectF ImageGrid::TestAPI::GetTransformedLayerBounds( const ui::Layer& layer) { @@ -304,5 +303,4 @@ void ImageGrid::ScaleHeight(gfx::Size center, transform.Scale(1.0, scale); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/image_grid.h b/ui/wm/core/image_grid.h index 0547157..49ac642 100644 --- a/ui/wm/core/image_grid.h +++ b/ui/wm/core/image_grid.h @@ -18,8 +18,7 @@ namespace gfx { class Image; } // namespace gfx -namespace views { -namespace corewm { +namespace wm { // An ImageGrid is a 3x3 array of ui::Layers, each containing an image. // @@ -222,7 +221,6 @@ class WM_CORE_EXPORT ImageGrid { DISALLOW_COPY_AND_ASSIGN(ImageGrid); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_IMAGE_GRID_H_ diff --git a/ui/wm/core/image_grid_unittest.cc b/ui/wm/core/image_grid_unittest.cc index 82fa4e3..4b413e4 100644 --- a/ui/wm/core/image_grid_unittest.cc +++ b/ui/wm/core/image_grid_unittest.cc @@ -10,8 +10,7 @@ #include "ui/gfx/image/image.h" #include "ui/gfx/image/image_skia.h" -namespace views { -namespace corewm { +namespace wm { namespace { @@ -338,5 +337,4 @@ TEST_F(ImageGridTest, TooSmall) { EXPECT_TRUE(test_api.bottom_right_clip_rect().IsEmpty()); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/input_method_event_filter.cc b/ui/wm/core/input_method_event_filter.cc index 7b84856..6006a93 100644 --- a/ui/wm/core/input_method_event_filter.cc +++ b/ui/wm/core/input_method_event_filter.cc @@ -11,8 +11,7 @@ #include "ui/events/event.h" #include "ui/events/event_processor.h" -namespace views { -namespace corewm { +namespace wm { //////////////////////////////////////////////////////////////////////////////// // InputMethodEventFilter, public: @@ -70,5 +69,4 @@ bool InputMethodEventFilter::DispatchKeyEventPostIME( return aura_event.handled(); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/input_method_event_filter.h b/ui/wm/core/input_method_event_filter.h index 9ed5216..17a6a0e 100644 --- a/ui/wm/core/input_method_event_filter.h +++ b/ui/wm/core/input_method_event_filter.h @@ -18,8 +18,7 @@ class EventProcessor; class InputMethod; } -namespace views { -namespace corewm { +namespace wm { // An event filter that forwards a KeyEvent to a system IME, and dispatches a // TranslatedKeyEvent to the root window as needed. @@ -49,7 +48,6 @@ class WM_CORE_EXPORT InputMethodEventFilter DISALLOW_COPY_AND_ASSIGN(InputMethodEventFilter); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_INPUT_METHOD_EVENT_FILTER_H_ diff --git a/ui/wm/core/input_method_event_filter_unittest.cc b/ui/wm/core/input_method_event_filter_unittest.cc index ef1a847..e5a35e8 100644 --- a/ui/wm/core/input_method_event_filter_unittest.cc +++ b/ui/wm/core/input_method_event_filter_unittest.cc @@ -22,8 +22,7 @@ DISABLED_TestInputMethodKeyEventPropagation #endif -namespace views { -namespace corewm { +namespace wm { typedef aura::test::AuraTestBase InputMethodEventFilterTest; @@ -87,5 +86,4 @@ TEST_F(InputMethodEventFilterTest, TestInputMethodKeyEventPropagation) { window.reset(); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/masked_window_targeter.cc b/ui/wm/core/masked_window_targeter.cc index c6277fb..4cc26d5 100644 --- a/ui/wm/core/masked_window_targeter.cc +++ b/ui/wm/core/masked_window_targeter.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/wm/public/masked_window_targeter.h" +#include "ui/wm/core/masked_window_targeter.h" #include "ui/aura/window.h" #include "ui/gfx/path.h" diff --git a/ui/wm/public/masked_window_targeter.h b/ui/wm/core/masked_window_targeter.h index ad3140d3..846021a 100644 --- a/ui/wm/public/masked_window_targeter.h +++ b/ui/wm/core/masked_window_targeter.h @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_WM_PUBLIC_MASKED_WINDOW_TARGETER_H_ -#define UI_WM_PUBLIC_MASKED_WINDOW_TARGETER_H_ +#ifndef UI_WM_CORE_MASKED_WINDOW_TARGETER_H_ +#define UI_WM_CORE_MASKED_WINDOW_TARGETER_H_ #include "ui/aura/window_targeter.h" +#include "ui/wm/core/wm_core_export.h" namespace gfx { class Path; @@ -13,7 +14,7 @@ class Path; namespace wm { -class MaskedWindowTargeter : public aura::WindowTargeter { +class WM_CORE_EXPORT MaskedWindowTargeter : public aura::WindowTargeter { public: explicit MaskedWindowTargeter(aura::Window* masked_window); virtual ~MaskedWindowTargeter(); @@ -36,4 +37,4 @@ class MaskedWindowTargeter : public aura::WindowTargeter { } // namespace wm -#endif // UI_WM_PUBLIC_MASKED_WINDOW_TARGETER_H_ +#endif // UI_WM_CORE_MASKED_WINDOW_TARGETER_H_ diff --git a/ui/wm/core/native_cursor_manager.h b/ui/wm/core/native_cursor_manager.h index def5c96..68c9d46 100644 --- a/ui/wm/core/native_cursor_manager.h +++ b/ui/wm/core/native_cursor_manager.h @@ -13,8 +13,7 @@ namespace gfx { class Display; } -namespace views { -namespace corewm { +namespace wm { // Interface where platforms such as Ash or Desktop aura are notified of // requested changes to cursor state. When requested, implementer should tell @@ -27,41 +26,40 @@ class WM_CORE_EXPORT NativeCursorManager { // A request to set the screen DPI. Can cause changes in the current cursor. virtual void SetDisplay( const gfx::Display& display, - views::corewm::NativeCursorManagerDelegate* delegate) = 0; + wm::NativeCursorManagerDelegate* delegate) = 0; // A request to set the cursor to |cursor|. At minimum, implementer should // call NativeCursorManagerDelegate::CommitCursor() with whatever cursor is // actually used. virtual void SetCursor( gfx::NativeCursor cursor, - views::corewm::NativeCursorManagerDelegate* delegate) = 0; + wm::NativeCursorManagerDelegate* delegate) = 0; // A request to set the visibility of the cursor. At minimum, implementer // should call NativeCursorManagerDelegate::CommitVisibility() with whatever // the visibility is. virtual void SetVisibility( bool visible, - views::corewm::NativeCursorManagerDelegate* delegate) = 0; + wm::NativeCursorManagerDelegate* delegate) = 0; // A request to set the scale of the cursor icon. virtual void SetScale( float scale, - views::corewm::NativeCursorManagerDelegate* delegate) = 0; + wm::NativeCursorManagerDelegate* delegate) = 0; // A request to set the scale of the cursor icon. virtual void SetCursorSet( ui::CursorSetType cursor_set, - views::corewm::NativeCursorManagerDelegate* delegate) = 0; + wm::NativeCursorManagerDelegate* delegate) = 0; // A request to set whether mouse events are disabled. At minimum, // implementer should call NativeCursorManagerDelegate:: // CommitMouseEventsEnabled() with whether mouse events are actually enabled. virtual void SetMouseEventsEnabled( bool enabled, - views::corewm::NativeCursorManagerDelegate* delegate) = 0; + wm::NativeCursorManagerDelegate* delegate) = 0; }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_ diff --git a/ui/wm/core/native_cursor_manager_delegate.h b/ui/wm/core/native_cursor_manager_delegate.h index c147700..0571d57 100644 --- a/ui/wm/core/native_cursor_manager_delegate.h +++ b/ui/wm/core/native_cursor_manager_delegate.h @@ -9,8 +9,7 @@ #include "ui/gfx/native_widget_types.h" #include "ui/wm/core/wm_core_export.h" -namespace views { -namespace corewm { +namespace wm { // The non-public interface that CursorManager exposes to its users. This // gives accessors to all the current state, and mutators to all the current @@ -30,7 +29,6 @@ class WM_CORE_EXPORT NativeCursorManagerDelegate { virtual void CommitMouseEventsEnabled(bool enabled) = 0; }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_NATIVE_CURSOR_MANAGER_DELEGATE_H_ diff --git a/ui/wm/core/shadow.cc b/ui/wm/core/shadow.cc index fb2d940..1eb0ac6 100644 --- a/ui/wm/core/shadow.cc +++ b/ui/wm/core/shadow.cc @@ -24,25 +24,25 @@ const int kSmallInteriorInset = 5; // Duration for opacity animation in milliseconds. const int kShadowAnimationDurationMs = 100; -float GetOpacityForStyle(views::corewm::Shadow::Style style) { +float GetOpacityForStyle(wm::Shadow::Style style) { switch (style) { - case views::corewm::Shadow::STYLE_ACTIVE: + case wm::Shadow::STYLE_ACTIVE: return kActiveShadowOpacity; - case views::corewm::Shadow::STYLE_INACTIVE: + case wm::Shadow::STYLE_INACTIVE: return kInactiveShadowOpacity; - case views::corewm::Shadow::STYLE_SMALL: + case wm::Shadow::STYLE_SMALL: return kSmallShadowOpacity; } return 1.0f; } -int GetInteriorInsetForStyle(views::corewm::Shadow::Style style) { +int GetInteriorInsetForStyle(wm::Shadow::Style style) { switch (style) { - case views::corewm::Shadow::STYLE_ACTIVE: + case wm::Shadow::STYLE_ACTIVE: return kActiveInteriorInset; - case views::corewm::Shadow::STYLE_INACTIVE: + case wm::Shadow::STYLE_INACTIVE: return kInactiveInteriorInset; - case views::corewm::Shadow::STYLE_SMALL: + case wm::Shadow::STYLE_SMALL: return kSmallInteriorInset; } return 0; @@ -50,8 +50,7 @@ int GetInteriorInsetForStyle(views::corewm::Shadow::Style style) { } // namespace -namespace views { -namespace corewm { +namespace wm { Shadow::Shadow() : style_(STYLE_ACTIVE), interior_inset_(0) { } @@ -191,5 +190,4 @@ void Shadow::UpdateImageGridBounds() { image_grid_->SetContentBounds(image_grid_bounds); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/shadow.h b/ui/wm/core/shadow.h index 0513782..fa42976 100644 --- a/ui/wm/core/shadow.h +++ b/ui/wm/core/shadow.h @@ -15,8 +15,7 @@ namespace ui { class Layer; } // namespace ui -namespace views { -namespace corewm { +namespace wm { class ImageGrid; @@ -82,7 +81,6 @@ class WM_CORE_EXPORT Shadow : public ui::ImplicitAnimationObserver { DISALLOW_COPY_AND_ASSIGN(Shadow); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_SHADOW_H_ diff --git a/ui/wm/core/shadow_controller.cc b/ui/wm/core/shadow_controller.cc index 5dcc942..31fb140 100644 --- a/ui/wm/core/shadow_controller.cc +++ b/ui/wm/core/shadow_controller.cc @@ -23,8 +23,7 @@ using std::make_pair; -namespace views { -namespace corewm { +namespace wm { namespace { @@ -270,5 +269,4 @@ Shadow* ShadowController::TestApi::GetShadowForWindow(aura::Window* window) { return controller_->impl_->GetShadowForWindow(window); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/shadow_controller.h b/ui/wm/core/shadow_controller.h index 3f3d1d9..d9451e7 100644 --- a/ui/wm/core/shadow_controller.h +++ b/ui/wm/core/shadow_controller.h @@ -23,8 +23,7 @@ namespace gfx { class Rect; } -namespace views { -namespace corewm { +namespace wm { class Shadow; @@ -65,7 +64,6 @@ class WM_CORE_EXPORT ShadowController : DISALLOW_COPY_AND_ASSIGN(ShadowController); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_SHADOW_CONTROLLER_H_ diff --git a/ui/wm/core/shadow_controller_unittest.cc b/ui/wm/core/shadow_controller_unittest.cc index 057f2b2..3f31b2f 100644 --- a/ui/wm/core/shadow_controller_unittest.cc +++ b/ui/wm/core/shadow_controller_unittest.cc @@ -19,8 +19,7 @@ #include "ui/wm/core/window_util.h" #include "ui/wm/core/wm_state.h" -namespace views { -namespace corewm { +namespace wm { class ShadowControllerTest : public aura::test::AuraTestBase { public: @@ -28,7 +27,7 @@ class ShadowControllerTest : public aura::test::AuraTestBase { virtual ~ShadowControllerTest() {} virtual void SetUp() OVERRIDE { - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); AuraTestBase::SetUp(); aura::client::ActivationClient* activation_client = aura::client::GetActivationClient(root_window()); @@ -52,7 +51,7 @@ class ShadowControllerTest : public aura::test::AuraTestBase { private: scoped_ptr<ShadowController> shadow_controller_; - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; DISALLOW_COPY_AND_ASSIGN(ShadowControllerTest); }; @@ -215,5 +214,4 @@ TEST_F(ShadowControllerTest, TransientParentKeepsActiveShadow) { EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow1->style()); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/shadow_types.cc b/ui/wm/core/shadow_types.cc index c6a590d7..a7afe89 100644 --- a/ui/wm/core/shadow_types.cc +++ b/ui/wm/core/shadow_types.cc @@ -6,10 +6,9 @@ #include "ui/aura/window_property.h" -DECLARE_WINDOW_PROPERTY_TYPE(views::corewm::ShadowType); +DECLARE_WINDOW_PROPERTY_TYPE(wm::ShadowType); -namespace views { -namespace corewm { +namespace wm { void SetShadowType(aura::Window* window, ShadowType shadow_type) { window->SetProperty(kShadowTypeKey, shadow_type); @@ -21,5 +20,4 @@ ShadowType GetShadowType(aura::Window* window) { DEFINE_WINDOW_PROPERTY_KEY(ShadowType, kShadowTypeKey, SHADOW_TYPE_NONE); -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/shadow_types.h b/ui/wm/core/shadow_types.h index 235b48f..49c92fd 100644 --- a/ui/wm/core/shadow_types.h +++ b/ui/wm/core/shadow_types.h @@ -12,8 +12,7 @@ namespace aura { class Window; } -namespace views { -namespace corewm { +namespace wm { // Different types of drop shadows that can be drawn under a window by the // shell. Used as a value for the kShadowTypeKey property. @@ -30,7 +29,6 @@ WM_CORE_EXPORT ShadowType GetShadowType(aura::Window* window); // window. If unset, no shadow is displayed. extern const aura::WindowProperty<ShadowType>* const kShadowTypeKey; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_SHADOW_TYPES_H_ diff --git a/ui/wm/core/transient_window_controller.cc b/ui/wm/core/transient_window_controller.cc index c0fbce1..bb1945c 100644 --- a/ui/wm/core/transient_window_controller.cc +++ b/ui/wm/core/transient_window_controller.cc @@ -6,8 +6,7 @@ #include "ui/wm/core/transient_window_manager.h" -namespace views { -namespace corewm { +namespace wm { TransientWindowController::TransientWindowController() { } @@ -38,5 +37,4 @@ const aura::Window* TransientWindowController::GetTransientParent( return window_manager ? window_manager->transient_parent() : NULL; } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/transient_window_controller.h b/ui/wm/core/transient_window_controller.h index 01a8de2..598904e 100644 --- a/ui/wm/core/transient_window_controller.h +++ b/ui/wm/core/transient_window_controller.h @@ -8,8 +8,7 @@ #include "ui/aura/client/transient_window_client.h" #include "ui/wm/core/wm_core_export.h" -namespace views { -namespace corewm { +namespace wm { // TransientWindowClient implementation. Uses TransientWindowManager to handle // tracking transient per window. @@ -32,7 +31,6 @@ class WM_CORE_EXPORT TransientWindowController DISALLOW_COPY_AND_ASSIGN(TransientWindowController); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_TRANSIENT_WINDOW_CONTROLLER_H_ diff --git a/ui/wm/core/transient_window_manager.cc b/ui/wm/core/transient_window_manager.cc index eb67bd3..6166e770 100644 --- a/ui/wm/core/transient_window_manager.cc +++ b/ui/wm/core/transient_window_manager.cc @@ -17,8 +17,7 @@ using aura::Window; -namespace views { -namespace corewm { +namespace wm { DEFINE_OWNED_WINDOW_PROPERTY_KEY(TransientWindowManager, kPropertyKey, NULL); @@ -152,5 +151,4 @@ void TransientWindowManager::OnWindowDestroying(Window* window) { DCHECK(transient_children_.empty()); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/transient_window_manager.h b/ui/wm/core/transient_window_manager.h index bd4ef02..0f84ba3 100644 --- a/ui/wm/core/transient_window_manager.h +++ b/ui/wm/core/transient_window_manager.h @@ -11,8 +11,7 @@ #include "ui/aura/window_observer.h" #include "ui/wm/core/wm_core_export.h" -namespace views { -namespace corewm { +namespace wm { class TransientWindowObserver; @@ -98,7 +97,6 @@ class WM_CORE_EXPORT TransientWindowManager : public aura::WindowObserver { DISALLOW_COPY_AND_ASSIGN(TransientWindowManager); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_TRANSIENT_WINDOW_MANAGER_H_ diff --git a/ui/wm/core/transient_window_manager_unittest.cc b/ui/wm/core/transient_window_manager_unittest.cc index c344552..5064854 100644 --- a/ui/wm/core/transient_window_manager_unittest.cc +++ b/ui/wm/core/transient_window_manager_unittest.cc @@ -19,8 +19,7 @@ using aura::Window; using aura::test::ChildWindowIDsAsString; using aura::test::CreateTestWindowWithId; -namespace views { -namespace corewm { +namespace wm { class TestTransientWindowObserver : public TransientWindowObserver { public: @@ -57,7 +56,7 @@ class TransientWindowManagerTest : public aura::test::AuraTestBase { virtual void SetUp() OVERRIDE { AuraTestBase::SetUp(); - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); } virtual void TearDown() OVERRIDE { @@ -78,7 +77,7 @@ class TransientWindowManagerTest : public aura::test::AuraTestBase { } private: - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; DISALLOW_COPY_AND_ASSIGN(TransientWindowManagerTest); }; @@ -634,5 +633,4 @@ TEST_F(TransientWindowManagerTest, TransientWindowObserverNotified) { TransientWindowManager::Get(parent.get())->RemoveObserver(&test_observer); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/transient_window_observer.h b/ui/wm/core/transient_window_observer.h index 0f7df7c..6a7a2e2 100644 --- a/ui/wm/core/transient_window_observer.h +++ b/ui/wm/core/transient_window_observer.h @@ -11,8 +11,7 @@ namespace aura { class Window; } -namespace views { -namespace corewm { +namespace wm { class WM_CORE_EXPORT TransientWindowObserver { public: @@ -28,7 +27,6 @@ class WM_CORE_EXPORT TransientWindowObserver { virtual ~TransientWindowObserver() {} }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_TRANSIENT_WINDOW_OBSERVER_H_ diff --git a/ui/wm/core/transient_window_stacking_client.cc b/ui/wm/core/transient_window_stacking_client.cc index c217bea..7ba7c6a 100644 --- a/ui/wm/core/transient_window_stacking_client.cc +++ b/ui/wm/core/transient_window_stacking_client.cc @@ -11,8 +11,7 @@ using aura::Window; -namespace views { -namespace corewm { +namespace wm { namespace { @@ -130,5 +129,4 @@ bool TransientWindowStackingClient::AdjustStacking( return *child != *target; } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/transient_window_stacking_client.h b/ui/wm/core/transient_window_stacking_client.h index 8384b3f..5641a22 100644 --- a/ui/wm/core/transient_window_stacking_client.h +++ b/ui/wm/core/transient_window_stacking_client.h @@ -8,8 +8,7 @@ #include "ui/aura/client/window_stacking_client.h" #include "ui/wm/core/wm_core_export.h" -namespace views { -namespace corewm { +namespace wm { class TransientWindowManager; @@ -33,7 +32,6 @@ class WM_CORE_EXPORT TransientWindowStackingClient DISALLOW_COPY_AND_ASSIGN(TransientWindowStackingClient); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_TRANSIENT_WINDOW_STACKING_CLIENT_H_ diff --git a/ui/wm/core/transient_window_stacking_client_unittest.cc b/ui/wm/core/transient_window_stacking_client_unittest.cc index c05520b..c5d3bd0 100644 --- a/ui/wm/core/transient_window_stacking_client_unittest.cc +++ b/ui/wm/core/transient_window_stacking_client_unittest.cc @@ -14,8 +14,7 @@ using aura::test::ChildWindowIDsAsString; using aura::test::CreateTestWindowWithId; using aura::Window; -namespace views { -namespace corewm { +namespace wm { class TransientWindowStackingClientTest : public aura::test::AuraTestBase { public: @@ -213,5 +212,4 @@ TEST_F(TransientWindowStackingClientTest, ui::test::ChildLayerNamesAsString(*root_window()->layer())); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/visibility_controller.cc b/ui/wm/core/visibility_controller.cc index d4c9784..fc187a9 100644 --- a/ui/wm/core/visibility_controller.cc +++ b/ui/wm/core/visibility_controller.cc @@ -9,8 +9,7 @@ #include "ui/compositor/layer.h" #include "ui/wm/core/window_animations.h" -namespace views { -namespace corewm { +namespace wm { namespace { @@ -86,6 +85,5 @@ void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { window->SetProperty(kChildWindowVisibilityChangesAnimatedKey, true); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/visibility_controller.h b/ui/wm/core/visibility_controller.h index 3a08aa3..912e974 100644 --- a/ui/wm/core/visibility_controller.h +++ b/ui/wm/core/visibility_controller.h @@ -10,8 +10,7 @@ #include "ui/aura/client/visibility_client.h" #include "ui/wm/core/wm_core_export.h" -namespace views { -namespace corewm { +namespace wm { class WM_CORE_EXPORT VisibilityController : public aura::client::VisibilityClient { @@ -70,7 +69,6 @@ class WM_CORE_EXPORT SuspendChildWindowVisibilityAnimations { void WM_CORE_EXPORT SetChildWindowVisibilityChangesAnimated( aura::Window* window); -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_VISIBILITY_CONTROLLER_H_ diff --git a/ui/wm/core/visibility_controller_unittest.cc b/ui/wm/core/visibility_controller_unittest.cc index 81e7978d..70d1386 100644 --- a/ui/wm/core/visibility_controller_unittest.cc +++ b/ui/wm/core/visibility_controller_unittest.cc @@ -14,8 +14,7 @@ #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/compositor/scoped_layer_animation_settings.h" -namespace views { -namespace corewm { +namespace wm { typedef aura::test::AuraTestBase VisibilityControllerTest; @@ -91,5 +90,4 @@ TEST_F(VisibilityControllerTest, AnimateTransparencyToZeroAndHideHides) { EXPECT_FALSE(window->IsVisible()); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/window_animations.cc b/ui/wm/core/window_animations.cc index feccce3..3b09188 100644 --- a/ui/wm/core/window_animations.cc +++ b/ui/wm/core/window_animations.cc @@ -37,8 +37,8 @@ #include "ui/wm/core/wm_core_switches.h" DECLARE_WINDOW_PROPERTY_TYPE(int) -DECLARE_WINDOW_PROPERTY_TYPE(views::corewm::WindowVisibilityAnimationType) -DECLARE_WINDOW_PROPERTY_TYPE(views::corewm::WindowVisibilityAnimationTransition) +DECLARE_WINDOW_PROPERTY_TYPE(wm::WindowVisibilityAnimationType) +DECLARE_WINDOW_PROPERTY_TYPE(wm::WindowVisibilityAnimationTransition) DECLARE_WINDOW_PROPERTY_TYPE(float) DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(WM_CORE_EXPORT, bool) @@ -46,8 +46,7 @@ using aura::Window; using base::TimeDelta; using ui::Layer; -namespace views { -namespace corewm { +namespace wm { namespace { const float kWindowAnimation_Vertical_TranslateY = 15.f; } // namespace @@ -554,5 +553,4 @@ bool WindowAnimationsDisabled(aura::Window* window) { switches::kWindowAnimationsDisabled)); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/window_animations.h b/ui/wm/core/window_animations.h index 2c7997d..73a8173 100644 --- a/ui/wm/core/window_animations.h +++ b/ui/wm/core/window_animations.h @@ -24,8 +24,7 @@ class Layer; class LayerAnimationSequence; } -namespace views { -namespace corewm { +namespace wm { // A variety of canned animations for window transitions. enum WindowVisibilityAnimationType { @@ -99,7 +98,6 @@ WM_CORE_EXPORT bool AnimateWindow(aura::Window* window, // if the global flag disabling window animations is present. WM_CORE_EXPORT bool WindowAnimationsDisabled(aura::Window* window); -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_WINDOW_ANIMATIONS_H_ diff --git a/ui/wm/core/window_animations_unittest.cc b/ui/wm/core/window_animations_unittest.cc index 20428fa..edce6af 100644 --- a/ui/wm/core/window_animations_unittest.cc +++ b/ui/wm/core/window_animations_unittest.cc @@ -18,8 +18,7 @@ using aura::Window; using ui::Layer; -namespace views { -namespace corewm { +namespace wm { class WindowAnimationsTest : public aura::test::AuraTestBase { public: @@ -129,7 +128,7 @@ TEST_F(WindowAnimationsTest, NotifyHideCompleted) { NotifyHideCompletedAnimationHost animation_host; scoped_ptr<aura::Window> window(aura::test::CreateTestWindowWithId(0, NULL)); aura::client::SetAnimationHost(window.get(), &animation_host); - views::corewm::SetWindowVisibilityAnimationType( + wm::SetWindowVisibilityAnimationType( window.get(), WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); AnimateOnChildWindowVisibilityChanged(window.get(), true); EXPECT_TRUE(window->layer()->visible()); @@ -139,5 +138,4 @@ TEST_F(WindowAnimationsTest, NotifyHideCompleted) { EXPECT_TRUE(animation_host.hide_completed()); } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/window_modality_controller.cc b/ui/wm/core/window_modality_controller.cc index 7372e1e..2eca7e2 100644 --- a/ui/wm/core/window_modality_controller.cc +++ b/ui/wm/core/window_modality_controller.cc @@ -19,8 +19,7 @@ #include "ui/wm/core/window_animations.h" #include "ui/wm/core/window_util.h" -namespace views { -namespace corewm { +namespace wm { // Transient child's modal parent. extern const aura::WindowProperty<aura::Window*>* const kModalParentKey; @@ -192,5 +191,4 @@ bool WindowModalityController::ProcessLocatedEvent(aura::Window* target, return !!modal_transient_child; } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/window_modality_controller.h b/ui/wm/core/window_modality_controller.h index f31162a..d098d57 100644 --- a/ui/wm/core/window_modality_controller.h +++ b/ui/wm/core/window_modality_controller.h @@ -18,8 +18,7 @@ class EventTarget; class LocatedEvent; } -namespace views { -namespace corewm { +namespace wm { // Sets the modal parent for the child. WM_CORE_EXPORT void SetModalParent(aura::Window* child, aura::Window* parent); @@ -67,7 +66,6 @@ class WM_CORE_EXPORT WindowModalityController : public ui::EventHandler, DISALLOW_COPY_AND_ASSIGN(WindowModalityController); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_WINDOW_MODALITY_CONTROLLER_H_ diff --git a/ui/wm/core/window_util.cc b/ui/wm/core/window_util.cc index 9af7cfa..dff8339 100644 --- a/ui/wm/core/window_util.cc +++ b/ui/wm/core/window_util.cc @@ -35,8 +35,7 @@ void CloneChildren(ui::Layer* to_clone, ui::Layer* parent) { } // namespace -namespace views { -namespace corewm { +namespace wm { void ActivateWindow(aura::Window* window) { DCHECK(window); @@ -127,5 +126,4 @@ bool HasTransientAncestor(const aura::Window* window, HasTransientAncestor(transient_parent, ancestor) : false; } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/window_util.h b/ui/wm/core/window_util.h index 3cb7484..81989f9 100644 --- a/ui/wm/core/window_util.h +++ b/ui/wm/core/window_util.h @@ -22,8 +22,7 @@ class LayerOwner; class LayerTreeOwner; } -namespace views { -namespace corewm { +namespace wm { WM_CORE_EXPORT void ActivateWindow(aura::Window* window); WM_CORE_EXPORT void DeactivateWindow(aura::Window* window); @@ -65,7 +64,6 @@ WM_CORE_EXPORT void RemoveTransientChild(aura::Window* parent, WM_CORE_EXPORT bool HasTransientAncestor(const aura::Window* window, const aura::Window* ancestor); -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_WINDOW_UTIL_H_ diff --git a/ui/wm/core/wm_core_export.h b/ui/wm/core/wm_core_export.h index c38c731..2056ccc 100644 --- a/ui/wm/core/wm_core_export.h +++ b/ui/wm/core/wm_core_export.h @@ -5,12 +5,6 @@ #ifndef UI_WM_CORE_WM_CORE_EXPORT_H_ #define UI_WM_CORE_WM_CORE_EXPORT_H_ -#include "ui/views/views_export.h" - -#if 1 -#define WM_CORE_EXPORT VIEWS_EXPORT -#else - // Defines WM_CORE_EXPORT so that functionality implemented by the Views module // can be exported to consumers. @@ -35,6 +29,4 @@ #define WM_CORE_EXPORT #endif -#endif - #endif // UI_WM_CORE_WM_CORE_EXPORT_H_ diff --git a/ui/wm/core/wm_core_switches.cc b/ui/wm/core/wm_core_switches.cc index a417ed8..12fbfcc 100644 --- a/ui/wm/core/wm_core_switches.cc +++ b/ui/wm/core/wm_core_switches.cc @@ -6,13 +6,11 @@ #include "base/command_line.h" -namespace views { -namespace corewm { +namespace wm { namespace switches { // If present animations are disabled. const char kWindowAnimationsDisabled[] = "wm-window-animations-disabled"; } // namespace switches -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/wm_core_switches.h b/ui/wm/core/wm_core_switches.h index 77bcdb0..dd48025 100644 --- a/ui/wm/core/wm_core_switches.h +++ b/ui/wm/core/wm_core_switches.h @@ -8,8 +8,7 @@ #include "build/build_config.h" #include "ui/wm/core/wm_core_export.h" -namespace views { -namespace corewm { +namespace wm { namespace switches { // Note: If you add a switch, consider if it needs to be copied to a subsequent @@ -20,7 +19,6 @@ namespace switches { WM_CORE_EXPORT extern const char kWindowAnimationsDisabled[]; } // namespace switches -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_WM_CORE_SWITCHES_H_ diff --git a/ui/wm/core/wm_state.cc b/ui/wm/core/wm_state.cc index aa2a5ef..afb84c7 100644 --- a/ui/wm/core/wm_state.cc +++ b/ui/wm/core/wm_state.cc @@ -7,8 +7,7 @@ #include "ui/wm/core/transient_window_controller.h" #include "ui/wm/core/transient_window_stacking_client.h" -namespace views { -namespace corewm { +namespace wm { WMState::WMState() : window_stacking_client_(new TransientWindowStackingClient), @@ -27,5 +26,4 @@ WMState::~WMState() { } } -} // namespace corewm -} // namespace views +} // namespace wm diff --git a/ui/wm/core/wm_state.h b/ui/wm/core/wm_state.h index f3573e0..b846f70 100644 --- a/ui/wm/core/wm_state.h +++ b/ui/wm/core/wm_state.h @@ -8,8 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "ui/wm/core/wm_core_export.h" -namespace views { -namespace corewm { +namespace wm { class TransientWindowController; class TransientWindowStackingClient; @@ -28,7 +27,6 @@ class WM_CORE_EXPORT WMState { DISALLOW_COPY_AND_ASSIGN(WMState); }; -} // namespace corewm -} // namespace views +} // namespace wm #endif // UI_WM_CORE_WM_STATE_H_ diff --git a/ui/wm/test/DEPS b/ui/wm/test/DEPS index 78adcc9..412f2e6 100644 --- a/ui/wm/test/DEPS +++ b/ui/wm/test/DEPS @@ -1,4 +1,7 @@ include_rules = [ "+ui/aura", + "+ui/base/resource/resource_bundle.h", + "+ui/base/ui_base_paths.h", + "+ui/gl", "+ui/views", ] diff --git a/ui/wm/test/run_all_unittests.cc b/ui/wm/test/run_all_unittests.cc new file mode 100644 index 0000000..d399ca1 --- /dev/null +++ b/ui/wm/test/run_all_unittests.cc @@ -0,0 +1,48 @@ +// Copyright 2014 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. + +#include "base/basictypes.h" +#include "base/bind.h" +#include "base/compiler_specific.h" +#include "base/path_service.h" +#include "base/test/launcher/unit_test_launcher.h" +#include "base/test/test_suite.h" +#include "ui/base/resource/resource_bundle.h" +#include "ui/base/ui_base_paths.h" +#include "ui/gl/gl_surface.h" + +class WMTestSuite : public base::TestSuite { + public: + WMTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} + + protected: + virtual void Initialize() OVERRIDE { + base::TestSuite::Initialize(); + gfx::GLSurface::InitializeOneOffForTests(); + ui::RegisterPathProvider(); + + base::FilePath pak_dir; + PathService::Get(base::DIR_MODULE, &pak_dir); + + base::FilePath pak_file; + pak_file = pak_dir.Append(FILE_PATH_LITERAL("ui_test.pak")); + + ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); + } + + virtual void Shutdown() OVERRIDE { + ui::ResourceBundle::CleanupSharedInstance(); + base::TestSuite::Shutdown(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(WMTestSuite); +}; + +int main(int argc, char** argv) { + WMTestSuite test_suite(argc, argv); + + return base::LaunchUnitTests( + argc, argv, base::Bind(&WMTestSuite::Run, base::Unretained(&test_suite))); +} diff --git a/ui/wm/test/wm_test_helper.cc b/ui/wm/test/wm_test_helper.cc index a8f9aa8..160923c8 100644 --- a/ui/wm/test/wm_test_helper.cc +++ b/ui/wm/test/wm_test_helper.cc @@ -23,11 +23,11 @@ WMTestHelper::WMTestHelper(const gfx::Size& default_window_size) { focus_client_.reset(new aura::test::TestFocusClient); aura::client::SetFocusClient(host_->window(), focus_client_.get()); - root_window_event_filter_ = new views::corewm::CompoundEventFilter; + root_window_event_filter_ = new wm::CompoundEventFilter; // Pass ownership of the filter to the root_window. host_->window()->SetEventFilter(root_window_event_filter_); - input_method_filter_.reset(new views::corewm::InputMethodEventFilter( + input_method_filter_.reset(new wm::InputMethodEventFilter( host_->GetAcceleratedWidget())); input_method_filter_->SetInputMethodPropertyInRootWindow(host_->window()); root_window_event_filter_->AddHandler(input_method_filter_.get()); diff --git a/ui/wm/test/wm_test_helper.h b/ui/wm/test/wm_test_helper.h index d6720c0..e01486b 100644 --- a/ui/wm/test/wm_test_helper.h +++ b/ui/wm/test/wm_test_helper.h @@ -25,12 +25,10 @@ class Rect; class Size; } -namespace views { -namespace corewm { +namespace wm { class CompoundEventFilter; class InputMethodEventFilter; } -} namespace wm { @@ -53,10 +51,10 @@ class WMTestHelper : public aura::client::WindowTreeClient { scoped_ptr<aura::WindowTreeHost> host_; // Owned by the root Window. - views::corewm::CompoundEventFilter* root_window_event_filter_; + wm::CompoundEventFilter* root_window_event_filter_; scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; - scoped_ptr<views::corewm::InputMethodEventFilter> input_method_filter_; + scoped_ptr<wm::InputMethodEventFilter> input_method_filter_; scoped_ptr<aura::client::DefaultActivationClient> activation_client_; scoped_ptr<aura::client::FocusClient> focus_client_; diff --git a/ui/wm/wm.gyp b/ui/wm/wm.gyp index 6071fac..9e7a308 100644 --- a/ui/wm/wm.gyp +++ b/ui/wm/wm.gyp @@ -16,11 +16,75 @@ '../gfx/gfx.gyp:gfx_geometry', ], 'sources': [ + 'public/window_types.h', + ], + }, + { + 'target_name': 'wm_core', + 'type': '<(component)', + 'dependencies': [ + '../../base/base.gyp:base', + '../../skia/skia.gyp:skia', + '../aura/aura.gyp:aura', + '../compositor/compositor.gyp:compositor', + '../events/events.gyp:events_base', + '../events/events.gyp:events', + '../gfx/gfx.gyp:gfx_geometry', + '../gfx/gfx.gyp:gfx', + '../resources/ui_resources.gyp:ui_resources', + '../base/ui_base.gyp:ui_base', + ], + 'defines': [ + 'WM_CORE_IMPLEMENTATION', + ], + 'sources': [ + 'core/base_focus_rules.cc', + 'core/base_focus_rules.h', + 'core/capture_controller.cc', + 'core/capture_controller.h', + 'core/compound_event_filter.cc', + 'core/compound_event_filter.h', + 'core/cursor_manager.cc', + 'core/cursor_manager.h', 'core/easy_resize_window_targeter.cc', + 'core/easy_resize_window_targeter.h', + 'core/focus_controller.cc', + 'core/focus_controller.h', + 'core/focus_rules.h', + 'core/image_grid.cc', + 'core/image_grid.h', + 'core/input_method_event_filter.cc', + 'core/input_method_event_filter.h', 'core/masked_window_targeter.cc', - 'public/easy_resize_window_targeter.h', - 'public/masked_window_targeter.h', - 'public/window_types.h', + 'core/masked_window_targeter.h', + 'core/native_cursor_manager.h', + 'core/native_cursor_manager_delegate.h', + 'core/shadow.cc', + 'core/shadow.h', + 'core/shadow_controller.cc', + 'core/shadow_controller.h', + 'core/shadow_types.cc', + 'core/shadow_types.h', + 'core/transient_window_controller.cc', + 'core/transient_window_controller.h', + 'core/transient_window_manager.cc', + 'core/transient_window_manager.h', + 'core/transient_window_observer.h', + 'core/transient_window_stacking_client.cc', + 'core/transient_window_stacking_client.h', + 'core/visibility_controller.cc', + 'core/visibility_controller.h', + 'core/window_animations.cc', + 'core/window_animations.h', + 'core/window_modality_controller.cc', + 'core/window_modality_controller.h', + 'core/window_util.cc', + 'core/window_util.h', + 'core/wm_core_export.h', + 'core/wm_core_switches.cc', + 'core/wm_core_switches.h', + 'core/wm_state.cc', + 'core/wm_state.h', ], }, { @@ -35,5 +99,38 @@ 'test/wm_test_helper.h', ], }, + { + 'target_name': 'wm_core_unittests', + 'type': 'executable', + 'dependencies': [ + '../../base/base.gyp:base', + '../../base/base.gyp:test_support_base', + '../../skia/skia.gyp:skia', + '../../testing/gtest.gyp:gtest', + '../aura/aura.gyp:aura', + '../aura/aura.gyp:aura_test_support', + '../compositor/compositor.gyp:compositor', + '../events/events.gyp:events_base', + '../events/events.gyp:events', + '../gfx/gfx.gyp:gfx_geometry', + '../gfx/gfx.gyp:gfx', + '../base/ui_base.gyp:ui_base', + 'wm_core', + 'wm_test_support', + ], + 'sources': [ + 'test/run_all_unittests.cc', + 'core/compound_event_filter_unittest.cc', + 'core/cursor_manager_unittest.cc', + 'core/focus_controller_unittest.cc', + 'core/input_method_event_filter_unittest.cc', + 'core/image_grid_unittest.cc', + 'core/shadow_controller_unittest.cc', + 'core/transient_window_manager_unittest.cc', + 'core/transient_window_stacking_client_unittest.cc', + 'core/visibility_controller_unittest.cc', + 'core/window_animations_unittest.cc', + ], + }, ], } |