diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-13 15:31:49 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-13 15:31:49 +0000 |
commit | 521c703f8d62fa698c3e88287c64d8d23f9ac675 (patch) | |
tree | 2e50833697a511a3cbc1f589fc4e17d466b82f03 | |
parent | 46e49bdb2dcac1f906d01c8373e9fc3c8ce2186c (diff) | |
download | chromium_src-521c703f8d62fa698c3e88287c64d8d23f9ac675.zip chromium_src-521c703f8d62fa698c3e88287c64d8d23f9ac675.tar.gz chromium_src-521c703f8d62fa698c3e88287c64d8d23f9ac675.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
Review URL: https://codereview.chromium.org/196063002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256839 0039d316-1c4b-4281-b951-d872f2087c98
197 files changed, 737 insertions, 755 deletions
diff --git a/ash/accelerators/accelerator_filter.cc b/ash/accelerators/accelerator_filter.cc index 64fe9a6..da552b9 100644 --- a/ash/accelerators/accelerator_filter.cc +++ b/ash/accelerators/accelerator_filter.cc @@ -47,7 +47,7 @@ bool IsSystemKey(ui::KeyboardCode key_code) { bool CanConsumeSystemKeys(aura::Window* target) { if (!target) // Can be NULL in tests. return false; - aura::Window* top_level = views::corewm::GetToplevelWindow(target); + aura::Window* top_level = ::wm::GetToplevelWindow(target); return top_level && wm::GetWindowState(top_level)->can_consume_system_keys(); } diff --git a/ash/ash.gyp b/ash/ash.gyp index 3bb2b5ebb..0ac87dd 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -39,6 +39,7 @@ '../ui/views/controls/webview/webview.gyp:webview', '../ui/views/views.gyp:views', '../ui/web_dialogs/web_dialogs.gyp:web_dialogs', + '../ui/wm/wm.gyp:wm_core', '../ui/wm/wm.gyp:wm_public', '../url/url.gyp:url_lib', 'ash_strings.gyp:ash_strings', @@ -838,6 +839,7 @@ '../ui/views/views.gyp:views_test_support', '../ui/views/views.gyp:views_with_content_test_support', '../ui/web_dialogs/web_dialogs.gyp:web_dialogs_test_support', + '../ui/wm/wm.gyp:wm_core', '../url/url.gyp:url_lib', 'ash_strings.gyp:ash_strings', 'ash', diff --git a/ash/default_user_wallpaper_delegate.cc b/ash/default_user_wallpaper_delegate.cc index f6fed24..99c1d58 100644 --- a/ash/default_user_wallpaper_delegate.cc +++ b/ash/default_user_wallpaper_delegate.cc @@ -11,7 +11,7 @@ namespace ash { int DefaultUserWallpaperDelegate::GetAnimationType() { - return views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE; + return wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE; } int DefaultUserWallpaperDelegate::GetAnimationDurationOverride() { diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc index 245df74..0f14604 100644 --- a/ash/desktop_background/desktop_background_view.cc +++ b/ash/desktop_background/desktop_background_view.cc @@ -191,7 +191,7 @@ views::Widget* CreateDesktopBackground(aura::Window* root_window, desktop_widget->SetContentsView( new LayerControlView(new DesktopBackgroundView())); int animation_type = wallpaper_delegate->GetAnimationType(); - views::corewm::SetWindowVisibilityAnimationType( + wm::SetWindowVisibilityAnimationType( desktop_widget->GetNativeView(), animation_type); RootWindowController* root_window_controller = @@ -205,18 +205,18 @@ views::Widget* CreateDesktopBackground(aura::Window* root_window, if (wallpaper_delegate->ShouldShowInitialAnimation() || root_window_controller->animating_wallpaper_controller() || Shell::GetInstance()->session_state_delegate()->NumberOfLoggedInUsers()) { - views::corewm::SetWindowVisibilityAnimationTransition( - desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); + wm::SetWindowVisibilityAnimationTransition( + desktop_widget->GetNativeView(), wm::ANIMATE_SHOW); int duration_override = wallpaper_delegate->GetAnimationDurationOverride(); if (duration_override) { - views::corewm::SetWindowVisibilityAnimationDuration( + wm::SetWindowVisibilityAnimationDuration( desktop_widget->GetNativeView(), base::TimeDelta::FromMilliseconds(duration_override)); } } else { // Disable animation if transition to login screen from an empty background. - views::corewm::SetWindowVisibilityAnimationTransition( - desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE); + wm::SetWindowVisibilityAnimationTransition( + desktop_widget->GetNativeView(), wm::ANIMATE_NONE); } desktop_widget->SetBounds(params.parent->bounds()); diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc index e76fdc4..c0079c8 100644 --- a/ash/display/screen_position_controller.cc +++ b/ash/display/screen_position_controller.cc @@ -40,7 +40,7 @@ void MoveAllTransientChildrenToNewRoot(const gfx::Display& display, aura::Window* dst_root = Shell::GetInstance()->display_controller()-> GetRootWindowForDisplayId(display.id()); aura::Window::Windows transient_children = - views::corewm::GetTransientChildren(window); + ::wm::GetTransientChildren(window); for (aura::Window::Windows::iterator iter = transient_children.begin(); iter != transient_children.end(); ++iter) { aura::Window* transient_child = *iter; @@ -163,7 +163,7 @@ void ScreenPositionController::SetBounds(aura::Window* window, // b) if the window or its ancestor has kStayInSameRootWindowkey. It's // intentionally kept in the same root window even if the bounds is // outside of the display. - if (!views::corewm::GetTransientParent(window) && + if (!::wm::GetTransientParent(window) && !ShouldStayInSameRootWindow(window)) { aura::Window* dst_root = Shell::GetInstance()->display_controller()->GetRootWindowForDisplayId( diff --git a/ash/drag_drop/drag_image_view.cc b/ash/drag_drop/drag_image_view.cc index c03b581..5beb81f 100644 --- a/ash/drag_drop/drag_image_view.cc +++ b/ash/drag_drop/drag_image_view.cc @@ -33,7 +33,7 @@ Widget* CreateDragWidget(gfx::NativeView context) { drag_widget->SetOpacity(0xFF); drag_widget->GetNativeWindow()->set_owned_by_parent(false); drag_widget->GetNativeWindow()->SetName("DragWidget"); - SetShadowType(drag_widget->GetNativeView(), views::corewm::SHADOW_TYPE_NONE); + SetShadowType(drag_widget->GetNativeView(), wm::SHADOW_TYPE_NONE); return drag_widget; } } diff --git a/ash/ime/candidate_window_view.cc b/ash/ime/candidate_window_view.cc index ac520f9..ca37b23 100644 --- a/ash/ime/candidate_window_view.cc +++ b/ash/ime/candidate_window_view.cc @@ -191,9 +191,9 @@ CandidateWindowView::~CandidateWindowView() { views::Widget* CandidateWindowView::InitWidget() { views::Widget* widget = BubbleDelegateView::CreateBubble(this); - views::corewm::SetWindowVisibilityAnimationType( + wm::SetWindowVisibilityAnimationType( widget->GetNativeView(), - views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); GetBubbleFrameView()->SetBubbleBorder(scoped_ptr<views::BubbleBorder>( new CandidateWindowBorder(parent_window()))); diff --git a/ash/ime/infolist_window.cc b/ash/ime/infolist_window.cc index b268ee7..e48e88e 100644 --- a/ash/ime/infolist_window.cc +++ b/ash/ime/infolist_window.cc @@ -211,9 +211,9 @@ InfolistWindow::~InfolistWindow() { void InfolistWindow::InitWidget() { views::Widget* widget = views::BubbleDelegateView::CreateBubble(this); - views::corewm::SetWindowVisibilityAnimationType( + wm::SetWindowVisibilityAnimationType( widget->GetNativeView(), - views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); // BubbleFrameView will be initialized through CreateBubble. GetBubbleFrameView()->SetBubbleBorder( diff --git a/ash/ime/mode_indicator_view.cc b/ash/ime/mode_indicator_view.cc index e7d514f..ccc1eae 100644 --- a/ash/ime/mode_indicator_view.cc +++ b/ash/ime/mode_indicator_view.cc @@ -58,9 +58,9 @@ ModeIndicatorView::ModeIndicatorView(gfx::NativeView parent, ModeIndicatorView::~ModeIndicatorView() {} void ModeIndicatorView::ShowAndFadeOut() { - views::corewm::SetWindowVisibilityAnimationTransition( + wm::SetWindowVisibilityAnimationTransition( GetWidget()->GetNativeView(), - views::corewm::ANIMATE_HIDE); + wm::ANIMATE_HIDE); GetWidget()->Show(); timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kShowingDuration), diff --git a/ash/popup_message.cc b/ash/popup_message.cc index bd1aea4..f321789 100644 --- a/ash/popup_message.cc +++ b/ash/popup_message.cc @@ -194,10 +194,10 @@ PopupMessage::PopupMessage(const base::string16& caption, widget_ = view_->GetWidget(); gfx::NativeView native_view = widget_->GetNativeView(); - views::corewm::SetWindowVisibilityAnimationType( - native_view, views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); - views::corewm::SetWindowVisibilityAnimationTransition( - native_view, views::corewm::ANIMATE_HIDE); + wm::SetWindowVisibilityAnimationType( + native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); + wm::SetWindowVisibilityAnimationTransition( + native_view, wm::ANIMATE_HIDE); view_->GetWidget()->Show(); } @@ -219,8 +219,8 @@ void PopupMessage::CancelHidingAnimation() { return; gfx::NativeView native_view = widget_->GetNativeView(); - views::corewm::SetWindowVisibilityAnimationTransition( - native_view, views::corewm::ANIMATE_NONE); + wm::SetWindowVisibilityAnimationTransition( + native_view, wm::ANIMATE_NONE); } } // namespace ash diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 0ba6a20..3982ad7 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc @@ -66,9 +66,9 @@ #include "ui/views/view_model.h" #include "ui/views/view_model_utils.h" #include "ui/wm/core/capture_controller.h" +#include "ui/wm/core/easy_resize_window_targeter.h" #include "ui/wm/core/visibility_controller.h" #include "ui/wm/core/window_util.h" -#include "ui/wm/public/easy_resize_window_targeter.h" #include "ui/wm/public/window_types.h" #if defined(OS_CHROMEOS) @@ -600,7 +600,7 @@ const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { while (topmost_window) { if (wm::GetWindowState(topmost_window)->IsFullscreen()) return topmost_window; - topmost_window = views::corewm::GetTransientParent(topmost_window); + topmost_window = ::wm::GetTransientParent(topmost_window); } return NULL; } @@ -668,8 +668,7 @@ RootWindowController::RootWindowController(aura::WindowTreeHost* host) stacking_controller_.reset(new StackingController); aura::client::SetWindowTreeClient(root_window(), stacking_controller_.get()); - capture_client_.reset( - new views::corewm::ScopedCaptureClient(root_window())); + capture_client_.reset(new ::wm::ScopedCaptureClient(root_window())); } void RootWindowController::Init(RootWindowType root_window_type, @@ -817,8 +816,7 @@ void RootWindowController::CreateContainersInRootWindow( kShellWindowId_DesktopBackgroundContainer, "DesktopBackgroundContainer", root_window); - views::corewm::SetChildWindowVisibilityChangesAnimated( - desktop_background_container); + ::wm::SetChildWindowVisibilityChangesAnimated(desktop_background_container); aura::Window* non_lock_screen_containers = CreateContainer( kShellWindowId_NonLockScreenContainersContainer, @@ -829,8 +827,7 @@ void RootWindowController::CreateContainersInRootWindow( kShellWindowId_LockScreenBackgroundContainer, "LockScreenBackgroundContainer", root_window); - views::corewm::SetChildWindowVisibilityChangesAnimated( - lock_background_containers); + ::wm::SetChildWindowVisibilityChangesAnimated(lock_background_containers); aura::Window* lock_screen_containers = CreateContainer( kShellWindowId_LockScreenContainersContainer, @@ -849,7 +846,7 @@ void RootWindowController::CreateContainersInRootWindow( kShellWindowId_DefaultContainer, "DefaultContainer", non_lock_screen_containers); - views::corewm::SetChildWindowVisibilityChangesAnimated(default_container); + ::wm::SetChildWindowVisibilityChangesAnimated(default_container); SetUsesScreenCoordinates(default_container); SetUsesEasyResizeTargeter(default_container); @@ -857,15 +854,14 @@ void RootWindowController::CreateContainersInRootWindow( kShellWindowId_AlwaysOnTopContainer, "AlwaysOnTopContainer", non_lock_screen_containers); - views::corewm::SetChildWindowVisibilityChangesAnimated( - always_on_top_container); + ::wm::SetChildWindowVisibilityChangesAnimated(always_on_top_container); SetUsesScreenCoordinates(always_on_top_container); aura::Window* docked_container = CreateContainer( kShellWindowId_DockedContainer, "DockedContainer", non_lock_screen_containers); - views::corewm::SetChildWindowVisibilityChangesAnimated(docked_container); + ::wm::SetChildWindowVisibilityChangesAnimated(docked_container); SetUsesScreenCoordinates(docked_container); SetUsesEasyResizeTargeter(docked_container); @@ -902,7 +898,7 @@ void RootWindowController::CreateContainersInRootWindow( non_lock_screen_containers); modal_container->SetLayoutManager( new SystemModalContainerLayoutManager(modal_container)); - views::corewm::SetChildWindowVisibilityChangesAnimated(modal_container); + ::wm::SetChildWindowVisibilityChangesAnimated(modal_container); SetUsesScreenCoordinates(modal_container); SetUsesEasyResizeTargeter(modal_container); @@ -910,8 +906,7 @@ void RootWindowController::CreateContainersInRootWindow( kShellWindowId_InputMethodContainer, "InputMethodContainer", non_lock_screen_containers); - views::corewm::SetChildWindowVisibilityChangesAnimated( - input_method_container); + ::wm::SetChildWindowVisibilityChangesAnimated(input_method_container); SetUsesScreenCoordinates(input_method_container); // TODO(beng): Figure out if we can make this use @@ -931,7 +926,7 @@ void RootWindowController::CreateContainersInRootWindow( lock_screen_containers); lock_modal_container->SetLayoutManager( new SystemModalContainerLayoutManager(lock_modal_container)); - views::corewm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); + ::wm::SetChildWindowVisibilityChangesAnimated(lock_modal_container); SetUsesScreenCoordinates(lock_modal_container); SetUsesEasyResizeTargeter(lock_modal_container); @@ -946,8 +941,7 @@ void RootWindowController::CreateContainersInRootWindow( kShellWindowId_SettingBubbleContainer, "SettingBubbleContainer", lock_screen_related_containers); - views::corewm::SetChildWindowVisibilityChangesAnimated( - settings_bubble_container); + ::wm::SetChildWindowVisibilityChangesAnimated(settings_bubble_container); SetUsesScreenCoordinates(settings_bubble_container); DescendantShouldStayInSameRootWindow(settings_bubble_container); @@ -955,14 +949,14 @@ void RootWindowController::CreateContainersInRootWindow( kShellWindowId_MenuContainer, "MenuContainer", lock_screen_related_containers); - views::corewm::SetChildWindowVisibilityChangesAnimated(menu_container); + ::wm::SetChildWindowVisibilityChangesAnimated(menu_container); SetUsesScreenCoordinates(menu_container); aura::Window* drag_drop_container = CreateContainer( kShellWindowId_DragImageAndTooltipContainer, "DragImageAndTooltipContainer", lock_screen_related_containers); - views::corewm::SetChildWindowVisibilityChangesAnimated(drag_drop_container); + ::wm::SetChildWindowVisibilityChangesAnimated(drag_drop_container); SetUsesScreenCoordinates(drag_drop_container); aura::Window* overlay_container = CreateContainer( diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h index d347d81..ddf6355 100644 --- a/ash/root_window_controller.h +++ b/ash/root_window_controller.h @@ -28,16 +28,6 @@ namespace gfx { class Point; } -namespace views { -class Widget; - -namespace corewm { -class InputMethodEventFilter; -class RootWindowEventFilter; -class ScopedCaptureClient; -} -} - namespace keyboard { class KeyboardController; } @@ -46,6 +36,16 @@ namespace ui { class EventHandler; } +namespace views { +class Widget; +} + +namespace wm { +class InputMethodEventFilter; +class RootWindowEventFilter; +class ScopedCaptureClient; +} + namespace ash { class ShelfWidget; class StackingController; @@ -307,7 +307,7 @@ class ASH_EXPORT RootWindowController : public ShellObserver { scoped_ptr<DesktopBackgroundWidgetController> wallpaper_controller_; scoped_ptr<AnimatingDesktopController> animating_wallpaper_controller_; - scoped_ptr<views::corewm::ScopedCaptureClient> capture_client_; + scoped_ptr< ::wm::ScopedCaptureClient> capture_client_; DISALLOW_COPY_AND_ASSIGN(RootWindowController); }; diff --git a/ash/shelf/shelf_tooltip_manager.cc b/ash/shelf/shelf_tooltip_manager.cc index 48b943f..15afb08 100644 --- a/ash/shelf/shelf_tooltip_manager.cc +++ b/ash/shelf/shelf_tooltip_manager.cc @@ -324,8 +324,8 @@ void ShelfTooltipManager::CancelHidingAnimation() { return; gfx::NativeView native_view = widget_->GetNativeView(); - views::corewm::SetWindowVisibilityAnimationTransition( - native_view, views::corewm::ANIMATE_NONE); + wm::SetWindowVisibilityAnimationTransition( + native_view, wm::ANIMATE_NONE); } void ShelfTooltipManager::CloseSoon() { @@ -359,10 +359,10 @@ void ShelfTooltipManager::CreateBubble(views::View* anchor, view_->SetText(text_); gfx::NativeView native_view = widget_->GetNativeView(); - views::corewm::SetWindowVisibilityAnimationType( - native_view, views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); - views::corewm::SetWindowVisibilityAnimationTransition( - native_view, views::corewm::ANIMATE_HIDE); + wm::SetWindowVisibilityAnimationType( + native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); + wm::SetWindowVisibilityAnimationTransition( + native_view, wm::ANIMATE_HIDE); } void ShelfTooltipManager::CreateTimer(int delay_in_ms) { diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc index 3595833..47c6d07 100644 --- a/ash/shelf/shelf_widget.cc +++ b/ash/shelf/shelf_widget.cc @@ -37,7 +37,7 @@ #include "ui/views/accessible_pane_view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" -#include "ui/wm/public/easy_resize_window_targeter.h" +#include "ui/wm/core/easy_resize_window_targeter.h" namespace { // Size of black border at bottom (or side) of shelf. diff --git a/ash/shelf/shelf_window_watcher_item_delegate.cc b/ash/shelf/shelf_window_watcher_item_delegate.cc index 0ba8f20..e1ce8ec 100644 --- a/ash/shelf/shelf_window_watcher_item_delegate.cc +++ b/ash/shelf/shelf_window_watcher_item_delegate.cc @@ -33,8 +33,7 @@ bool ShelfWindowWatcherItemDelegate::ItemSelected(const ui::Event& event) { wm::WindowState* window_state = wm::GetWindowState(window_); if (window_state->IsActive()) { if (event.type() & ui::ET_KEY_RELEASED) { - views::corewm::AnimateWindow(window_, - views::corewm::WINDOW_ANIMATION_TYPE_BOUNCE); + ::wm::AnimateWindow(window_, ::wm::WINDOW_ANIMATION_TYPE_BOUNCE); } else { window_state->Minimize(); } diff --git a/ash/shell.cc b/ash/shell.cc index ee56b83..e11f49e 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -143,13 +143,13 @@ using views::Widget; // A Corewm VisibilityController subclass that calls the Ash animation routine // so we can pick up our extended animations. See ash/wm/window_animations.h. -class AshVisibilityController : public views::corewm::VisibilityController { +class AshVisibilityController : public ::wm::VisibilityController { public: AshVisibilityController() {} virtual ~AshVisibilityController() {} private: - // Overridden from views::corewm::VisibilityController: + // Overridden from ::wm::VisibilityController: virtual bool CallAnimateOnChildWindowVisibilityChanged( aura::Window* window, bool visible) OVERRIDE { @@ -601,7 +601,7 @@ Shell::Shell(ShellDelegate* delegate) output_configurator_(new chromeos::OutputConfigurator()), #endif // defined(OS_CHROMEOS) && defined(USE_X11) native_cursor_manager_(new AshNativeCursorManager), - cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>( + cursor_manager_(scoped_ptr< ::wm::NativeCursorManager>( native_cursor_manager_)), simulate_modal_window_open_for_testing_(false), is_touch_hud_projection_enabled_(false) { @@ -813,15 +813,15 @@ void Shell::Init() { // pretarget handler list to ensure that it processes input events when modal // windows are active. window_modality_controller_.reset( - new views::corewm::WindowModalityController(this)); + new ::wm::WindowModalityController(this)); AddPreTargetHandler(this); - env_filter_.reset(new views::corewm::CompoundEventFilter); + env_filter_.reset(new ::wm::CompoundEventFilter); AddPreTargetHandler(env_filter_.get()); - views::corewm::FocusController* focus_controller = - new views::corewm::FocusController(new wm::AshFocusRules); + ::wm::FocusController* focus_controller = + new ::wm::FocusController(new wm::AshFocusRules); focus_client_.reset(focus_controller); activation_client_ = focus_controller; activation_client_->AddObserver(this); @@ -870,7 +870,7 @@ void Shell::Init() { AddPreTargetHandler(overlay_filter_.get()); AddShellObserver(overlay_filter_.get()); - input_method_filter_.reset(new views::corewm::InputMethodEventFilter( + input_method_filter_.reset(new ::wm::InputMethodEventFilter( root_window->GetHost()->GetAcceleratedWidget())); AddPreTargetHandler(input_method_filter_.get()); @@ -945,7 +945,7 @@ void Shell::Init() { resize_shadow_controller_.reset(new internal::ResizeShadowController()); shadow_controller_.reset( - new views::corewm::ShadowController(activation_client_)); + new ::wm::ShadowController(activation_client_)); // Create system_tray_notifier_ before the delegate. system_tray_notifier_.reset(new ash::SystemTrayNotifier()); @@ -1038,8 +1038,8 @@ void Shell::InitRootWindow(aura::Window* root_window) { aura::client::SetFocusClient(root_window, focus_client_.get()); input_method_filter_->SetInputMethodPropertyInRootWindow(root_window); aura::client::SetActivationClient(root_window, activation_client_); - views::corewm::FocusController* focus_controller = - static_cast<views::corewm::FocusController*>(activation_client_); + ::wm::FocusController* focus_controller = + static_cast< ::wm::FocusController*>(activation_client_); root_window->AddPreTargetHandler(focus_controller); aura::client::SetVisibilityClient(root_window, visibility_controller_.get()); aura::client::SetDragDropClient(root_window, drag_drop_controller_.get()); diff --git a/ash/shell.h b/ash/shell.h index 57b9a14..67de216 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -63,14 +63,17 @@ namespace views { class NonClientFrameView; class Widget; namespace corewm { +class TooltipController; +} +} + +namespace wm { class CompoundEventFilter; class InputMethodEventFilter; class ShadowController; -class TooltipController; class VisibilityController; class WindowModalityController; } -} namespace ash { @@ -333,10 +336,10 @@ class ASH_EXPORT Shell internal::DisplayManager* display_manager() { return display_manager_.get(); } - views::corewm::InputMethodEventFilter* input_method_filter() { + ::wm::InputMethodEventFilter* input_method_filter() { return input_method_filter_.get(); } - views::corewm::CompoundEventFilter* env_filter() { + ::wm::CompoundEventFilter* env_filter() { return env_filter_.get(); } views::corewm::TooltipController* tooltip_controller() { @@ -378,7 +381,7 @@ class ASH_EXPORT Shell internal::EventTransformationHandler* event_transformation_handler() { return event_transformation_handler_.get(); } - views::corewm::CursorManager* cursor_manager() { return &cursor_manager_; } + ::wm::CursorManager* cursor_manager() { return &cursor_manager_; } ShellDelegate* delegate() { return delegate_.get(); } @@ -486,7 +489,7 @@ class ASH_EXPORT Shell } // Made available for tests. - views::corewm::ShadowController* shadow_controller() { + ::wm::ShadowController* shadow_controller() { return shadow_controller_.get(); } @@ -609,7 +612,7 @@ class ASH_EXPORT Shell aura::Window* scoped_target_root_window_; // The CompoundEventFilter owned by aura::Env object. - scoped_ptr<views::corewm::CompoundEventFilter> env_filter_; + scoped_ptr< ::wm::CompoundEventFilter> env_filter_; std::vector<WindowAndBoundsPair> to_restore_; @@ -636,10 +639,9 @@ class ASH_EXPORT Shell scoped_ptr<internal::DragDropController> drag_drop_controller_; scoped_ptr<internal::ResizeShadowController> resize_shadow_controller_; - scoped_ptr<views::corewm::ShadowController> shadow_controller_; - scoped_ptr<views::corewm::VisibilityController> visibility_controller_; - scoped_ptr<views::corewm::WindowModalityController> - window_modality_controller_; + scoped_ptr< ::wm::ShadowController> shadow_controller_; + scoped_ptr< ::wm::VisibilityController> visibility_controller_; + scoped_ptr< ::wm::WindowModalityController> window_modality_controller_; scoped_ptr<views::corewm::TooltipController> tooltip_controller_; scoped_ptr<DesktopBackgroundController> desktop_background_controller_; scoped_ptr<PowerButtonController> power_button_controller_; @@ -681,7 +683,7 @@ class ASH_EXPORT Shell scoped_ptr<internal::AcceleratorFilter> accelerator_filter_; // An event filter that pre-handles all key events to send them to an IME. - scoped_ptr<views::corewm::InputMethodEventFilter> input_method_filter_; + scoped_ptr< ::wm::InputMethodEventFilter> input_method_filter_; scoped_ptr<internal::DisplayManager> display_manager_; scoped_ptr<base::WeakPtrFactory<internal::DisplayManager> > @@ -723,7 +725,7 @@ class ASH_EXPORT Shell // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a // pointer to vend to test code. AshNativeCursorManager* native_cursor_manager_; - views::corewm::CursorManager cursor_manager_; + ::wm::CursorManager cursor_manager_; ObserverList<ShellObserver> observers_; diff --git a/ash/shell/content_client/shell_browser_main_parts.cc b/ash/shell/content_client/shell_browser_main_parts.cc index edb6e1a..d809807 100644 --- a/ash/shell/content_client/shell_browser_main_parts.cc +++ b/ash/shell/content_client/shell_browser_main_parts.cc @@ -98,7 +98,7 @@ void ShellBrowserMainParts::PostMainMessageLoopStart() { } void ShellBrowserMainParts::ToolkitInitialized() { - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); } void ShellBrowserMainParts::PreMainMessageLoopRun() { diff --git a/ash/shell/content_client/shell_browser_main_parts.h b/ash/shell/content_client/shell_browser_main_parts.h index 229c868..0e07cbf 100644 --- a/ash/shell/content_client/shell_browser_main_parts.h +++ b/ash/shell/content_client/shell_browser_main_parts.h @@ -22,11 +22,9 @@ namespace net { class NetLog; } -namespace views { -namespace corewm { +namespace wm { class WMState; } -} namespace ash { namespace shell { @@ -57,7 +55,7 @@ class ShellBrowserMainParts : public content::BrowserMainParts { scoped_ptr<content::ShellBrowserContext> browser_context_; scoped_ptr<ash::shell::WindowWatcher> window_watcher_; ShellDelegateImpl* delegate_; // owned by Shell - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts); }; diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc index 5d1b314..9352823 100644 --- a/ash/shell/window_type_launcher.cc +++ b/ash/shell/window_type_launcher.cc @@ -195,8 +195,8 @@ void InitWindowTypeLauncher() { Shell::GetPrimaryRootWindow(), gfx::Rect(120, 150, 300, 410)); widget->GetNativeView()->SetName("WindowTypeLauncher"); - views::corewm::SetShadowType(widget->GetNativeView(), - views::corewm::SHADOW_TYPE_RECTANGULAR); + wm::SetShadowType(widget->GetNativeView(), + wm::SHADOW_TYPE_RECTANGULAR); widget->Show(); } diff --git a/ash/system/tray/tray_background_view.cc b/ash/system/tray/tray_background_view.cc index c610ee4..f6af7c8 100644 --- a/ash/system/tray/tray_background_view.cc +++ b/ash/system/tray/tray_background_view.cc @@ -493,13 +493,13 @@ void TrayBackgroundView::SetTrayBorder() { void TrayBackgroundView::InitializeBubbleAnimations( views::Widget* bubble_widget) { - views::corewm::SetWindowVisibilityAnimationType( + wm::SetWindowVisibilityAnimationType( bubble_widget->GetNativeWindow(), - views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); - views::corewm::SetWindowVisibilityAnimationTransition( + wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + wm::SetWindowVisibilityAnimationTransition( bubble_widget->GetNativeWindow(), - views::corewm::ANIMATE_HIDE); - views::corewm::SetWindowVisibilityAnimationDuration( + wm::ANIMATE_HIDE); + wm::SetWindowVisibilityAnimationDuration( bubble_widget->GetNativeWindow(), base::TimeDelta::FromMilliseconds(kAnimationDurationForPopupMS)); } diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc index bd01bbe..d5cf839 100644 --- a/ash/system/user/tray_user.cc +++ b/ash/system/user/tray_user.cc @@ -973,7 +973,7 @@ void UserView::ToggleAddUserMenuOption() { add_menu_option_->SetOpacity(0xFF); add_menu_option_->GetNativeWindow()->set_owned_by_parent(false); SetShadowType(add_menu_option_->GetNativeView(), - views::corewm::SHADOW_TYPE_NONE); + wm::SHADOW_TYPE_NONE); // Position it below our user card. gfx::Rect bounds = user_card_view_->GetBoundsInScreen(); diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index 50e9841..33dbb83 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc @@ -52,7 +52,7 @@ AshTestHelper::~AshTestHelper() { } void AshTestHelper::SetUp(bool start_session) { - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); // Disable animations during tests. zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( @@ -126,7 +126,7 @@ void AshTestHelper::TearDown() { ui::ShutdownInputMethodForTesting(); zero_duration_mode_.reset(); - CHECK(!views::corewm::ScopedCaptureClient::IsActive()); + CHECK(!wm::ScopedCaptureClient::IsActive()); wm_state_.reset(); } diff --git a/ash/test/ash_test_helper.h b/ash/test/ash_test_helper.h index 706cfeb..a1974cb 100644 --- a/ash/test/ash_test_helper.h +++ b/ash/test/ash_test_helper.h @@ -20,11 +20,9 @@ namespace ui { class ScopedAnimationDurationScaleMode; } // namespace ui -namespace views { -namespace corewm { +namespace wm { class WMState; } -} namespace ash { namespace test { @@ -68,7 +66,7 @@ class AshTestHelper { // Owned by ash::AcceleratorController TestScreenshotDelegate* test_screenshot_delegate_; - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; // Check if DBus Thread Manager was initialized here. bool dbus_thread_manager_initialized_; diff --git a/ash/test/cursor_manager_test_api.cc b/ash/test/cursor_manager_test_api.cc index b4c289a..0b7711b9 100644 --- a/ash/test/cursor_manager_test_api.cc +++ b/ash/test/cursor_manager_test_api.cc @@ -15,7 +15,7 @@ namespace ash { namespace test { CursorManagerTestApi::CursorManagerTestApi( - views::corewm::CursorManager* cursor_manager) + wm::CursorManager* cursor_manager) : cursor_manager_(cursor_manager) { } diff --git a/ash/test/cursor_manager_test_api.h b/ash/test/cursor_manager_test_api.h index 9cffac5..d368216 100644 --- a/ash/test/cursor_manager_test_api.h +++ b/ash/test/cursor_manager_test_api.h @@ -13,11 +13,9 @@ namespace gfx { class Display; } -namespace views { -namespace corewm { +namespace wm { class CursorManager; } -} namespace ash { namespace test { @@ -25,7 +23,7 @@ namespace test { // Use the api in this class to test CursorManager. class CursorManagerTestApi { public: - explicit CursorManagerTestApi(views::corewm::CursorManager* cursor_manager); + explicit CursorManagerTestApi(::wm::CursorManager* cursor_manager); ~CursorManagerTestApi(); float GetCurrentScale() const; @@ -34,7 +32,7 @@ class CursorManagerTestApi { gfx::Display GetDisplay() const; private: - views::corewm::CursorManager* cursor_manager_; + ::wm::CursorManager* cursor_manager_; DISALLOW_COPY_AND_ASSIGN(CursorManagerTestApi); }; diff --git a/ash/test/shell_test_api.cc b/ash/test/shell_test_api.cc index 07efa52..5d2ec11 100644 --- a/ash/test/shell_test_api.cc +++ b/ash/test/shell_test_api.cc @@ -22,7 +22,7 @@ internal::RootWindowLayoutManager* ShellTestApi::root_window_layout() { return shell_->GetPrimaryRootWindowController()->root_window_layout(); } -views::corewm::InputMethodEventFilter* +wm::InputMethodEventFilter* ShellTestApi::input_method_event_filter() { return shell_->input_method_filter_.get(); } diff --git a/ash/test/shell_test_api.h b/ash/test/shell_test_api.h index 7306b3d..12e40b7 100644 --- a/ash/test/shell_test_api.h +++ b/ash/test/shell_test_api.h @@ -7,11 +7,9 @@ #include "base/basictypes.h" -namespace views { -namespace corewm { +namespace wm { class InputMethodEventFilter; -} // namespace corewm -} // namespace views +} // namespace wm namespace ash { class AshNativeCursorManager; @@ -37,7 +35,7 @@ public: explicit ShellTestApi(Shell* shell); internal::RootWindowLayoutManager* root_window_layout(); - views::corewm::InputMethodEventFilter* input_method_event_filter(); + ::wm::InputMethodEventFilter* input_method_event_filter(); internal::SystemGestureEventFilter* system_gesture_event_filter(); internal::WorkspaceController* workspace_controller(); internal::ScreenPositionController* screen_position_controller(); diff --git a/ash/wm/ash_focus_rules.cc b/ash/wm/ash_focus_rules.cc index 453436d..efeaaca 100644 --- a/ash/wm/ash_focus_rules.cc +++ b/ash/wm/ash_focus_rules.cc @@ -55,7 +55,7 @@ AshFocusRules::~AshFocusRules() { } //////////////////////////////////////////////////////////////////////////////// -// AshFocusRules, views::corewm::FocusRules: +// AshFocusRules, ::wm::FocusRules: bool AshFocusRules::SupportsChildActivation(aura::Window* window) const { if (window->id() == internal::kShellWindowId_DefaultContainer) diff --git a/ash/wm/ash_focus_rules.h b/ash/wm/ash_focus_rules.h index 5780573..b5774a2 100644 --- a/ash/wm/ash_focus_rules.h +++ b/ash/wm/ash_focus_rules.h @@ -13,13 +13,13 @@ namespace ash { namespace wm { -class ASH_EXPORT AshFocusRules : public views::corewm::BaseFocusRules { +class ASH_EXPORT AshFocusRules : public ::wm::BaseFocusRules { public: AshFocusRules(); virtual ~AshFocusRules(); private: - // Overridden from views::corewm::BaseFocusRules: + // Overridden from ::wm::BaseFocusRules: virtual bool SupportsChildActivation(aura::Window* window) const OVERRIDE; virtual bool IsWindowConsideredVisibleForActivation( aura::Window* window) const OVERRIDE; diff --git a/ash/wm/ash_native_cursor_manager.cc b/ash/wm/ash_native_cursor_manager.cc index a8349c0..ba56a7c 100644 --- a/ash/wm/ash_native_cursor_manager.cc +++ b/ash/wm/ash_native_cursor_manager.cc @@ -63,14 +63,14 @@ AshNativeCursorManager::~AshNativeCursorManager() { void AshNativeCursorManager::SetNativeCursorEnabled(bool enabled) { native_cursor_enabled_ = enabled; - views::corewm::CursorManager* cursor_manager = + ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager(); SetCursor(cursor_manager->GetCursor(), cursor_manager); } void AshNativeCursorManager::SetDisplay( const gfx::Display& display, - views::corewm::NativeCursorManagerDelegate* delegate) { + ::wm::NativeCursorManagerDelegate* delegate) { if (image_cursors_->SetDisplay(display)) SetCursor(delegate->GetCursor(), delegate); #if defined(OS_CHROMEOS) @@ -81,7 +81,7 @@ void AshNativeCursorManager::SetDisplay( void AshNativeCursorManager::SetCursor( gfx::NativeCursor cursor, - views::corewm::NativeCursorManagerDelegate* delegate) { + ::wm::NativeCursorManagerDelegate* delegate) { gfx::NativeCursor new_cursor = cursor; if (native_cursor_enabled_) { image_cursors_->SetPlatformCursor(&new_cursor); @@ -105,7 +105,7 @@ void AshNativeCursorManager::SetCursor( void AshNativeCursorManager::SetCursorSet( ui::CursorSetType cursor_set, - views::corewm::NativeCursorManagerDelegate* delegate) { + ::wm::NativeCursorManagerDelegate* delegate) { image_cursors_->SetCursorSet(cursor_set); delegate->CommitCursorSet(cursor_set); @@ -121,7 +121,7 @@ void AshNativeCursorManager::SetCursorSet( void AshNativeCursorManager::SetScale( float scale, - views::corewm::NativeCursorManagerDelegate* delegate) { + ::wm::NativeCursorManagerDelegate* delegate) { image_cursors_->SetScale(scale); delegate->CommitScale(scale); @@ -131,7 +131,7 @@ void AshNativeCursorManager::SetScale( void AshNativeCursorManager::SetVisibility( bool visible, - views::corewm::NativeCursorManagerDelegate* delegate) { + ::wm::NativeCursorManagerDelegate* delegate) { delegate->CommitVisibility(visible); if (visible) { @@ -147,7 +147,7 @@ void AshNativeCursorManager::SetVisibility( void AshNativeCursorManager::SetMouseEventsEnabled( bool enabled, - views::corewm::NativeCursorManagerDelegate* delegate) { + ::wm::NativeCursorManagerDelegate* delegate) { delegate->CommitMouseEventsEnabled(enabled); if (enabled) { diff --git a/ash/wm/ash_native_cursor_manager.h b/ash/wm/ash_native_cursor_manager.h index b9a36ffb..7124bdc 100644 --- a/ash/wm/ash_native_cursor_manager.h +++ b/ash/wm/ash_native_cursor_manager.h @@ -28,7 +28,7 @@ class ImageCursors; // NativeCursorManagerDelegate interface, which receives messages about what // changes were acted on. class ASH_EXPORT AshNativeCursorManager - : public views::corewm::NativeCursorManager { + : public ::wm::NativeCursorManager { public: AshNativeCursorManager(); virtual ~AshNativeCursorManager(); @@ -42,25 +42,25 @@ class ASH_EXPORT AshNativeCursorManager private: friend class test::CursorManagerTestApi; - // 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 SetScale( float scale, - 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 SetMouseEventsEnabled( bool enabled, - views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE; + ::wm::NativeCursorManagerDelegate* delegate) OVERRIDE; // The cursor location where the cursor was disabled. gfx::Point disabled_cursor_location_; diff --git a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc index 97cefdb..9adb852 100644 --- a/ash/wm/ash_native_cursor_manager_interactive_uitest.cc +++ b/ash/wm/ash_native_cursor_manager_interactive_uitest.cc @@ -21,7 +21,7 @@ namespace ash { -using views::corewm::CursorManager; +using ::wm::CursorManager; typedef test::AshTestBase AshNativeCursorManagerTest; namespace { diff --git a/ash/wm/ash_native_cursor_manager_unittest.cc b/ash/wm/ash_native_cursor_manager_unittest.cc index 1e26f53..5d9ab1e 100644 --- a/ash/wm/ash_native_cursor_manager_unittest.cc +++ b/ash/wm/ash_native_cursor_manager_unittest.cc @@ -19,7 +19,7 @@ #include "ui/base/cursor/cursor_loader_win.h" #endif -using views::corewm::CursorManager; +using ::wm::CursorManager; namespace ash { namespace test { diff --git a/ash/wm/caption_buttons/maximize_bubble_controller_bubble.cc b/ash/wm/caption_buttons/maximize_bubble_controller_bubble.cc index 2753659..12e35ec 100644 --- a/ash/wm/caption_buttons/maximize_bubble_controller_bubble.cc +++ b/ash/wm/caption_buttons/maximize_bubble_controller_bubble.cc @@ -18,7 +18,7 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/mouse_watcher.h" -#include "ui/wm/public/masked_window_targeter.h" +#include "ui/wm/core/masked_window_targeter.h" namespace ash { diff --git a/ash/wm/default_state.cc b/ash/wm/default_state.cc index a6ea571..1c9909a 100644 --- a/ash/wm/default_state.cc +++ b/ash/wm/default_state.cc @@ -443,7 +443,7 @@ void DefaultState::UpdateBounds(WindowState* window_state, // Save the previous show state so that we can correctly restore it. window_state->window()->SetProperty(aura::client::kRestoreShowStateKey, ToWindowShowState(old_state_type)); - views::corewm::SetWindowVisibilityAnimationType( + ::wm::SetWindowVisibilityAnimationType( window_state->window(), WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); // Hide the window. diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc index d81c34a..63ad210 100644 --- a/ash/wm/dock/docked_window_layout_manager.cc +++ b/ash/wm/dock/docked_window_layout_manager.cc @@ -221,7 +221,7 @@ namespace { // Returns true if a window is a popup or a transient child. bool IsPopupOrTransient(const aura::Window* window) { return (window->type() == ui::wm::WINDOW_TYPE_POPUP || - views::corewm::GetTransientParent(window)); + ::wm::GetTransientParent(window)); } // Certain windows (minimized, hidden or popups) do not matter to docking. @@ -834,15 +834,15 @@ void DockedWindowLayoutManager::OnWindowVisibilityChanging( aura::Window* window, bool visible) { if (IsPopupOrTransient(window)) return; - int animation_type = views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT; + int animation_type = ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT; if (visible) { - animation_type = views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_DROP; - views::corewm::SetWindowVisibilityAnimationDuration( + animation_type = ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_DROP; + ::wm::SetWindowVisibilityAnimationDuration( window, base::TimeDelta::FromMilliseconds(kFadeDurationMs)); } else if (wm::GetWindowState(window)->IsMinimized()) { animation_type = WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE; } - views::corewm::SetWindowVisibilityAnimationType(window, animation_type); + ::wm::SetWindowVisibilityAnimationType(window, animation_type); } void DockedWindowLayoutManager::OnWindowDestroying(aura::Window* window) { diff --git a/ash/wm/dock/docked_window_resizer_unittest.cc b/ash/wm/dock/docked_window_resizer_unittest.cc index 82b87ef..65f7658 100644 --- a/ash/wm/dock/docked_window_resizer_unittest.cc +++ b/ash/wm/dock/docked_window_resizer_unittest.cc @@ -1445,10 +1445,10 @@ TEST_P(DockedWindowResizerTest, DragWindowWithTransientChild) { scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); scoped_ptr<aura::Window> child(CreateTestWindowInShellWithDelegateAndType( NULL, ui::wm::WINDOW_TYPE_NORMAL, 0, gfx::Rect(20, 20, 150, 20))); - views::corewm::AddTransientChild(window.get(), child.get()); + ::wm::AddTransientChild(window.get(), child.get()); if (window->parent() != child->parent()) window->parent()->AddChild(child.get()); - EXPECT_EQ(window.get(), views::corewm::GetTransientParent(child.get())); + EXPECT_EQ(window.get(), ::wm::GetTransientParent(child.get())); DragToVerticalPositionAndToEdge(DOCKED_EDGE_RIGHT, window.get(), 20); @@ -1495,8 +1495,8 @@ TEST_P(DockedWindowResizerTest, DragWindowWithModalTransientChild) { // While still dragging create a modal window and make it a transient child of // the |window|. scoped_ptr<aura::Window> child(CreateModalWindow(gfx::Rect(20, 20, 150, 20))); - views::corewm::AddTransientChild(window.get(), child.get()); - EXPECT_EQ(window.get(), views::corewm::GetTransientParent(child.get())); + ::wm::AddTransientChild(window.get(), child.get()); + EXPECT_EQ(window.get(), ::wm::GetTransientParent(child.get())); EXPECT_EQ(internal::kShellWindowId_SystemModalContainer, child->parent()->id()); @@ -1516,7 +1516,7 @@ TEST_P(DockedWindowResizerTest, DragWindowWithModalTransientChild) { EXPECT_EQ(gfx::Point(20, 20).ToString(), child->GetBoundsInScreen().origin().ToString()); // The |child| should still be a transient child of |window|. - EXPECT_EQ(window.get(), views::corewm::GetTransientParent(child.get())); + EXPECT_EQ(window.get(), ::wm::GetTransientParent(child.get())); } // Tests that side snapping a window undocks it, closes the dock and then snaps. diff --git a/ash/wm/drag_window_controller.cc b/ash/wm/drag_window_controller.cc index 25d0e04..516d59f 100644 --- a/ash/wm/drag_window_controller.cc +++ b/ash/wm/drag_window_controller.cc @@ -76,7 +76,7 @@ void DragWindowController::CreateDragWidget(const gfx::Rect& bounds) { drag_widget_->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow); // Show shadow for the dragging window. SetShadowType(drag_widget_->GetNativeWindow(), - views::corewm::SHADOW_TYPE_RECTANGULAR); + ::wm::SHADOW_TYPE_RECTANGULAR); SetBoundsInternal(bounds); drag_widget_->StackAbove(window_); @@ -108,7 +108,7 @@ void DragWindowController::SetBoundsInternal(const gfx::Rect& bounds) { void DragWindowController::RecreateWindowLayers() { DCHECK(!layer_owner_.get()); - layer_owner_ = views::corewm::RecreateLayers(window_); + layer_owner_ = ::wm::RecreateLayers(window_); layer_owner_->root()->set_delegate(window_->layer()->delegate()); // Place the layer at (0, 0) of the DragWindowController's window. gfx::Rect layer_bounds = layer_owner_->root()->bounds(); diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc index 1824e2b..2b91f85 100644 --- a/ash/wm/drag_window_resizer.cc +++ b/ash/wm/drag_window_resizer.cc @@ -206,7 +206,7 @@ void DragWindowResizer::UpdateDragWindow(const gfx::Rect& bounds, bool DragWindowResizer::ShouldAllowMouseWarp() { return (details().window_component == HTCAPTION) && - !views::corewm::GetTransientParent(GetTarget()) && + !::wm::GetTransientParent(GetTarget()) && (GetTarget()->type() == ui::wm::WINDOW_TYPE_NORMAL || GetTarget()->type() == ui::wm::WINDOW_TYPE_PANEL); } diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc index bbd3279..3ea9c3c 100644 --- a/ash/wm/drag_window_resizer_unittest.cc +++ b/ash/wm/drag_window_resizer_unittest.cc @@ -79,7 +79,7 @@ class DragWindowResizerTest : public test::AshTestBase { transient_parent_->SetType(ui::wm::WINDOW_TYPE_NORMAL); transient_parent_->Init(aura::WINDOW_LAYER_NOT_DRAWN); ParentWindowInPrimaryRootWindow(transient_parent_.get()); - views::corewm::AddTransientChild(transient_parent_.get(), transient_child_); + ::wm::AddTransientChild(transient_parent_.get(), transient_child_); transient_parent_->set_id(5); panel_window_.reset(new aura::Window(&delegate6_)); diff --git a/ash/wm/immersive_fullscreen_controller.cc b/ash/wm/immersive_fullscreen_controller.cc index 9b21269..9912308 100644 --- a/ash/wm/immersive_fullscreen_controller.cc +++ b/ash/wm/immersive_fullscreen_controller.cc @@ -87,7 +87,7 @@ bool IsWindowTransientChildOf(aura::Window* maybe_transient, return false; for (aura::Window* window = maybe_transient; window; - window = views::corewm::GetTransientParent(window)) { + window = ::wm::GetTransientParent(window)) { if (window == toplevel) return true; } @@ -527,7 +527,7 @@ void ImmersiveFullscreenController::EnableWindowObservers(bool enable) { widget_->AddObserver(this); focus_manager->AddFocusChangeListener(this); Shell::GetInstance()->AddPreTargetHandler(this); - views::corewm::TransientWindowManager::Get(native_window_)-> + ::wm::TransientWindowManager::Get(native_window_)-> AddObserver(this); RecreateBubbleManager(); @@ -535,7 +535,7 @@ void ImmersiveFullscreenController::EnableWindowObservers(bool enable) { widget_->RemoveObserver(this); focus_manager->RemoveFocusChangeListener(this); Shell::GetInstance()->RemovePreTargetHandler(this); - views::corewm::TransientWindowManager::Get(native_window_)-> + ::wm::TransientWindowManager::Get(native_window_)-> RemoveObserver(this); // We have stopped observing whether transient children are added or removed @@ -919,7 +919,7 @@ bool ImmersiveFullscreenController::ShouldHandleGestureEvent( void ImmersiveFullscreenController::RecreateBubbleManager() { bubble_manager_.reset(new BubbleManager(this)); const std::vector<aura::Window*> transient_children = - views::corewm::GetTransientChildren(native_window_); + ::wm::GetTransientChildren(native_window_); for (size_t i = 0; i < transient_children.size(); ++i) { aura::Window* transient_child = transient_children[i]; views::BubbleDelegateView* bubble_delegate = diff --git a/ash/wm/immersive_fullscreen_controller.h b/ash/wm/immersive_fullscreen_controller.h index 9bbc71e..b98b32f 100644 --- a/ash/wm/immersive_fullscreen_controller.h +++ b/ash/wm/immersive_fullscreen_controller.h @@ -41,7 +41,7 @@ namespace ash { class ASH_EXPORT ImmersiveFullscreenController : public gfx::AnimationDelegate, public ui::EventHandler, - public views::corewm::TransientWindowObserver, + public ::wm::TransientWindowObserver, public views::FocusChangeListener, public views::WidgetObserver, public ImmersiveRevealedLock::Delegate { @@ -143,7 +143,7 @@ class ASH_EXPORT ImmersiveFullscreenController virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; - // views::corewm::TransientWindowObserver overrides: + // ::wm::TransientWindowObserver overrides: virtual void OnTransientChildAdded(aura::Window* window, aura::Window* transient) OVERRIDE; virtual void OnTransientChildRemoved(aura::Window* window, diff --git a/ash/wm/maximize_mode/workspace_backdrop_delegate.cc b/ash/wm/maximize_mode/workspace_backdrop_delegate.cc index 093e403..54347a2 100644 --- a/ash/wm/maximize_mode/workspace_backdrop_delegate.cc +++ b/ash/wm/maximize_mode/workspace_backdrop_delegate.cc @@ -51,7 +51,7 @@ WorkspaceBackdropDelegate::~WorkspaceBackdropDelegate() { ui::ScopedLayerAnimationSettings settings( background_->GetNativeView()->layer()->GetAnimator()); background_->Close(); - settings.AddObserver(views::corewm::CreateHidingWindowAnimationObserver( + settings.AddObserver(::wm::CreateHidingWindowAnimationObserver( background_->GetNativeView())); background_->GetNativeView()->layer()->SetOpacity(0.0f); } diff --git a/ash/wm/overview/scoped_transform_overview_window.cc b/ash/wm/overview/scoped_transform_overview_window.cc index 19bbcb5..bf7cff9 100644 --- a/ash/wm/overview/scoped_transform_overview_window.cc +++ b/ash/wm/overview/scoped_transform_overview_window.cc @@ -65,7 +65,7 @@ void SetTransformOnWindowAndAllTransientChildren( SetTransformOnWindow(window, transform, animate); aura::Window::Windows transient_children = - views::corewm::GetTransientChildren(window); + ::wm::GetTransientChildren(window); for (aura::Window::Windows::iterator iter = transient_children.begin(); iter != transient_children.end(); ++iter) { aura::Window* transient_child = *iter; @@ -80,7 +80,7 @@ void SetTransformOnWindowAndAllTransientChildren( aura::Window* GetModalTransientParent(aura::Window* window) { if (window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_WINDOW) - return views::corewm::GetTransientParent(window); + return ::wm::GetTransientParent(window); return NULL; } @@ -239,8 +239,8 @@ void ScopedTransformOverviewWindow::SetTransformOnWindowAndTransientChildren( bool animate) { gfx::Point origin(GetBoundsInScreen().origin()); aura::Window* window = window_; - while (views::corewm::GetTransientParent(window)) - window = views::corewm::GetTransientParent(window); + while (::wm::GetTransientParent(window)) + window = ::wm::GetTransientParent(window); for (ScopedVector<ScopedWindowCopy>::const_iterator iter = window_copies_.begin(); iter != window_copies_.end(); ++iter) { SetTransformOnWindow( diff --git a/ash/wm/overview/scoped_window_copy.cc b/ash/wm/overview/scoped_window_copy.cc index 7368b45..c3fa51d 100644 --- a/ash/wm/overview/scoped_window_copy.cc +++ b/ash/wm/overview/scoped_window_copy.cc @@ -42,8 +42,8 @@ views::Widget* CreateCopyOfWindow(aura::Window* target_root, widget->SetVisibilityChangedAnimationsEnabled(false); std::string name = src_window->name() + " (Copy)"; widget->GetNativeWindow()->SetName(name); - views::corewm::SetShadowType(widget->GetNativeWindow(), - views::corewm::SHADOW_TYPE_RECTANGULAR); + ::wm::SetShadowType(widget->GetNativeWindow(), + ::wm::SHADOW_TYPE_RECTANGULAR); // Set the bounds in the target root window. gfx::Display target_display = @@ -160,7 +160,7 @@ void CleanupWidgetAfterAnimationObserver::MaybeDestruct() { ScopedWindowCopy::ScopedWindowCopy(aura::Window* target_root, aura::Window* src_window) { scoped_ptr<ui::LayerTreeOwner> layer_owner = - views::corewm::RecreateLayers(src_window); + ::wm::RecreateLayers(src_window); widget_ = CreateCopyOfWindow(target_root, src_window, layer_owner->root()); cleanup_observer_ = new CleanupWidgetAfterAnimationObserver(widget_, layer_owner.Pass()); diff --git a/ash/wm/overview/window_selector.cc b/ash/wm/overview/window_selector.cc index 18f04b3..c36be04 100644 --- a/ash/wm/overview/window_selector.cc +++ b/ash/wm/overview/window_selector.cc @@ -361,7 +361,7 @@ void WindowSelector::OnWindowAdded(aura::Window* new_window) { for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) { if (new_window->parent()->id() == kSwitchableWindowContainerIds[i] && - !views::corewm::GetTransientParent(new_window)) { + !::wm::GetTransientParent(new_window)) { // The new window is in one of the switchable containers, abort overview. CancelSelection(); return; diff --git a/ash/wm/overview/window_selector_item.h b/ash/wm/overview/window_selector_item.h index 0ea7178..eedf3e1 100644 --- a/ash/wm/overview/window_selector_item.h +++ b/ash/wm/overview/window_selector_item.h @@ -86,7 +86,7 @@ class WindowSelectorItem { gfx::Rect bounds_; // True if running SetItemBounds. This prevents recursive calls resulting from - // the bounds update when calling views::corewm::RecreateWindowLayers to copy + // the bounds update when calling ::wm::RecreateWindowLayers to copy // a window layer for display on another monitor. bool in_bounds_update_; diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index 64aa56c..d3edb7a 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc @@ -728,7 +728,7 @@ TEST_F(WindowSelectorTest, ModalChild) { scoped_ptr<aura::Window> window1(CreateWindow(bounds)); scoped_ptr<aura::Window> child1(CreateWindow(bounds)); child1->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); - views::corewm::AddTransientChild(window1.get(), child1.get()); + ::wm::AddTransientChild(window1.get(), child1.get()); EXPECT_EQ(window1->parent(), child1->parent()); ToggleOverview(); EXPECT_TRUE(window1->IsVisible()); @@ -744,7 +744,7 @@ TEST_F(WindowSelectorTest, ClickModalWindowParent) { scoped_ptr<aura::Window> window1(CreateWindow(gfx::Rect(0, 0, 180, 180))); scoped_ptr<aura::Window> child1(CreateWindow(gfx::Rect(200, 0, 180, 180))); child1->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); - views::corewm::AddTransientChild(window1.get(), child1.get()); + ::wm::AddTransientChild(window1.get(), child1.get()); EXPECT_FALSE(WindowsOverlapping(window1.get(), child1.get())); EXPECT_EQ(window1->parent(), child1->parent()); ToggleOverview(); @@ -865,7 +865,7 @@ TEST_F(WindowSelectorTest, CycleMultipleDisplaysCopiesWindows) { unmoved2->SetName("unmoved2"); moved1->SetName("moved1"); moved1->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); - views::corewm::AddTransientChild(moved1_trans_parent.get(), moved1.get()); + ::wm::AddTransientChild(moved1_trans_parent.get(), moved1.get()); moved1_trans_parent->SetName("moved1_trans_parent"); EXPECT_EQ(root_windows[0], moved1->GetRootWindow()); diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc index 9392303..690c23a 100644 --- a/ash/wm/panels/panel_layout_manager.cc +++ b/ash/wm/panels/panel_layout_manager.cc @@ -545,7 +545,7 @@ void PanelLayoutManager::WillChangeVisibilityState( // PanelLayoutManager private implementation: void PanelLayoutManager::MinimizePanel(aura::Window* panel) { - views::corewm::SetWindowVisibilityAnimationType( + ::wm::SetWindowVisibilityAnimationType( panel, WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE); ui::Layer* layer = panel->layer(); ui::ScopedLayerAnimationSettings panel_slide_settings(layer->GetAnimator()); diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc index 74329f0..4debaed 100644 --- a/ash/wm/panels/panel_window_resizer_unittest.cc +++ b/ash/wm/panels/panel_window_resizer_unittest.cc @@ -508,10 +508,10 @@ TEST_P(PanelWindowResizerTransientTest, PanelWithTransientChild) { scoped_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0))); scoped_ptr<aura::Window> child(CreateTestWindowInShellWithDelegateAndType( NULL, transient_window_type_, 0, gfx::Rect(20, 20, 150, 40))); - views::corewm::AddTransientChild(window.get(), child.get()); + ::wm::AddTransientChild(window.get(), child.get()); if (window->parent() != child->parent()) window->parent()->AddChild(child.get()); - EXPECT_EQ(window.get(), views::corewm::GetTransientParent(child.get())); + EXPECT_EQ(window.get(), ::wm::GetTransientParent(child.get())); // Drag the child to the shelf. Its new position should not be overridden. const gfx::Rect attached_bounds(window->GetBoundsInScreen()); diff --git a/ash/wm/resize_shadow.cc b/ash/wm/resize_shadow.cc index 7d4a61c..65f6623 100644 --- a/ash/wm/resize_shadow.cc +++ b/ash/wm/resize_shadow.cc @@ -49,7 +49,7 @@ ResizeShadow::~ResizeShadow() {} void ResizeShadow::Init(aura::Window* window) { // Set up our image grid and images. ResourceBundle& res = ResourceBundle::GetSharedInstance(); - image_grid_.reset(new views::corewm::ImageGrid); + image_grid_.reset(new ::wm::ImageGrid); image_grid_->SetImages( &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_TOP_LEFT), &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_TOP), diff --git a/ash/wm/resize_shadow.h b/ash/wm/resize_shadow.h index f61f393..8b05d92 100644 --- a/ash/wm/resize_shadow.h +++ b/ash/wm/resize_shadow.h @@ -17,11 +17,9 @@ class Rect; namespace ui { class Layer; } -namespace views { -namespace corewm { +namespace wm { class ImageGrid; } -} namespace ash { namespace internal { @@ -53,7 +51,7 @@ class ResizeShadow { private: // Images for the shadow effect. - scoped_ptr<views::corewm::ImageGrid> image_grid_; + scoped_ptr< ::wm::ImageGrid> image_grid_; // Hit test value from last call to ShowForHitTest(). Used to prevent // repeatedly triggering the same animations for the same hit. diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc index b99f832..62263d4 100644 --- a/ash/wm/stacking_controller.cc +++ b/ash/wm/stacking_controller.cc @@ -39,8 +39,8 @@ bool IsSystemModal(aura::Window* window) { } bool HasTransientParentWindow(const aura::Window* window) { - return views::corewm::GetTransientParent(window) && - views::corewm::GetTransientParent(window)->type() != + return ::wm::GetTransientParent(window) && + ::wm::GetTransientParent(window)->type() != ui::wm::WINDOW_TYPE_UNKNOWN; } @@ -68,7 +68,7 @@ aura::Window* StackingController::GetDefaultParent(aura::Window* context, aura::Window* window, const gfx::Rect& bounds) { aura::Window* target_root = NULL; - aura::Window* transient_parent = views::corewm::GetTransientParent(window); + aura::Window* transient_parent = ::wm::GetTransientParent(window); if (transient_parent) { // Transient window should use the same root as its transient parent. target_root = transient_parent->GetRootWindow(); @@ -83,7 +83,7 @@ aura::Window* StackingController::GetDefaultParent(aura::Window* context, return GetSystemModalContainer(target_root, window); else if (HasTransientParentWindow(window)) return internal::RootWindowController::GetContainerForWindow( - views::corewm::GetTransientParent(window)); + ::wm::GetTransientParent(window)); return GetAlwaysOnTopController(target_root)->GetContainer(window); case ui::wm::WINDOW_TYPE_CONTROL: return GetContainerById( @@ -123,7 +123,7 @@ aura::Window* StackingController::GetSystemModalContainer( SessionStateDelegate* session_state_delegate = Shell::GetInstance()->session_state_delegate(); if (!session_state_delegate->IsUserSessionBlocked() || - !views::corewm::GetTransientParent(window)) { + !::wm::GetTransientParent(window)) { return GetContainerById(root, internal::kShellWindowId_SystemModalContainer); } @@ -131,7 +131,7 @@ aura::Window* StackingController::GetSystemModalContainer( // Otherwise those that originate from LockScreen container and above are // placed in the screen lock modal container. int window_container_id = - views::corewm::GetTransientParent(window)->parent()->id(); + ::wm::GetTransientParent(window)->parent()->id(); aura::Window* container = NULL; if (window_container_id < internal::kShellWindowId_LockScreenContainer) { container = GetContainerById( diff --git a/ash/wm/stacking_controller_unittest.cc b/ash/wm/stacking_controller_unittest.cc index 4b9edc2..c975169 100644 --- a/ash/wm/stacking_controller_unittest.cc +++ b/ash/wm/stacking_controller_unittest.cc @@ -49,7 +49,7 @@ TEST_F(StackingControllerTest, TransientParent) { // Window with a transient parent. scoped_ptr<Window> w1(CreateTestWindow()); - views::corewm::AddTransientChild(w2.get(), w1.get()); + ::wm::AddTransientChild(w2.get(), w1.get()); w1->SetBounds(gfx::Rect(10, 11, 250, 251)); ParentWindowInPrimaryRootWindow(w1.get()); w1->Show(); diff --git a/ash/wm/system_modal_container_layout_manager.cc b/ash/wm/system_modal_container_layout_manager.cc index 42cbb05..faba106 100644 --- a/ash/wm/system_modal_container_layout_manager.cc +++ b/ash/wm/system_modal_container_layout_manager.cc @@ -177,7 +177,7 @@ void SystemModalContainerLayoutManager::DestroyModalBackground() { ui::ScopedLayerAnimationSettings settings( modal_background_->GetNativeView()->layer()->GetAnimator()); modal_background_->Close(); - settings.AddObserver(views::corewm::CreateHidingWindowAnimationObserver( + settings.AddObserver(::wm::CreateHidingWindowAnimationObserver( modal_background_->GetNativeView())); modal_background_->GetNativeView()->layer()->SetOpacity(0.0f); modal_background_ = NULL; diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc index 530e447..af7c4f3 100644 --- a/ash/wm/system_modal_container_layout_manager_unittest.cc +++ b/ash/wm/system_modal_container_layout_manager_unittest.cc @@ -162,7 +162,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, NonModalTransient) { TransientWindowObserver destruction_observer; transient->AddObserver(&destruction_observer); - EXPECT_EQ(parent.get(), views::corewm::GetTransientParent(transient)); + EXPECT_EQ(parent.get(), ::wm::GetTransientParent(transient)); EXPECT_EQ(parent->parent(), transient->parent()); // The transient should be destroyed with its parent. @@ -179,7 +179,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalTransient) { TransientWindowObserver do1; t1->AddObserver(&do1); - EXPECT_EQ(parent.get(), views::corewm::GetTransientParent(t1)); + EXPECT_EQ(parent.get(), ::wm::GetTransientParent(t1)); EXPECT_EQ(GetModalContainer(), t1->parent()); // t1 should now be active. @@ -197,7 +197,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalTransient) { EXPECT_TRUE(wm::IsActiveWindow(t2)); - EXPECT_EQ(t1, views::corewm::GetTransientParent(t2)); + EXPECT_EQ(t1, ::wm::GetTransientParent(t2)); EXPECT_EQ(GetModalContainer(), t2->parent()); // t2 should still be active, even after clicking on t1. @@ -218,7 +218,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalNonTransient) { TransientWindowObserver do1; t1->AddObserver(&do1); - EXPECT_EQ(NULL, views::corewm::GetTransientParent(t1.get())); + EXPECT_EQ(NULL, ::wm::GetTransientParent(t1.get())); EXPECT_EQ(GetModalContainer(), t1->parent()); // t1 should now be active. @@ -237,7 +237,7 @@ TEST_F(SystemModalContainerLayoutManagerTest, ModalNonTransient) { EXPECT_TRUE(wm::IsActiveWindow(t2)); - EXPECT_EQ(t1, views::corewm::GetTransientParent(t2)); + EXPECT_EQ(t1, ::wm::GetTransientParent(t2)); EXPECT_EQ(GetModalContainer(), t2->parent()); // t2 should still be active, even after clicking on t1. diff --git a/ash/wm/toplevel_window_event_handler_unittest.cc b/ash/wm/toplevel_window_event_handler_unittest.cc index 1d24cc6..437a519 100644 --- a/ash/wm/toplevel_window_event_handler_unittest.cc +++ b/ash/wm/toplevel_window_event_handler_unittest.cc @@ -357,7 +357,7 @@ TEST_F(ToplevelWindowEventHandlerTest, DontDragIfModalChild) { scoped_ptr<aura::Window> w2(CreateWindow(HTCAPTION)); w2->SetBounds(gfx::Rect(100, 0, 100, 100)); w2->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); - views::corewm::AddTransientChild(w1.get(), w2.get()); + ::wm::AddTransientChild(w1.get(), w2.get()); gfx::Size size = w1->bounds().size(); // Attempt to drag w1, position and size should not change because w1 has a diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc index a5b3653..7bae5a3 100644 --- a/ash/wm/window_animations.cc +++ b/ash/wm/window_animations.cc @@ -69,7 +69,7 @@ int64 Round64(float f) { base::TimeDelta GetCrossFadeDuration(aura::Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { - if (views::corewm::WindowAnimationsDisabled(window)) + if (::wm::WindowAnimationsDisabled(window)) return base::TimeDelta(); int old_area = old_bounds.width() * old_bounds.height(); @@ -165,8 +165,8 @@ void AnimateShowWindow_Minimize(aura::Window* window) { // Now that the window has been restored, we need to clear its animation style // to default so that normal animation applies. - views::corewm::SetWindowVisibilityAnimationType( - window, views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT); + ::wm::SetWindowVisibilityAnimationType( + window, ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT); } void AnimateHideWindow_Minimize(aura::Window* window) { @@ -178,7 +178,7 @@ void AnimateHideWindow_Minimize(aura::Window* window) { kLayerAnimationsForMinimizeDurationMS); settings.SetTransitionDuration(duration); settings.AddObserver( - views::corewm::CreateHidingWindowAnimationObserver(window)); + ::wm::CreateHidingWindowAnimationObserver(window)); window->layer()->SetVisible(false); AddLayerAnimationsForMinimize(window, false); @@ -211,7 +211,7 @@ void AnimateShowHideWindowCommon_BrightnessGrayscale(aura::Window* window, settings.SetTransitionDuration(duration); if (!show) { settings.AddObserver( - views::corewm::CreateHidingWindowAnimationObserver(window)); + ::wm::CreateHidingWindowAnimationObserver(window)); } window->layer()->GetAnimator()-> @@ -232,12 +232,12 @@ void AnimateHideWindow_BrightnessGrayscale(aura::Window* window) { } bool AnimateShowWindow(aura::Window* window) { - if (!views::corewm::HasWindowVisibilityAnimationTransition( - window, views::corewm::ANIMATE_SHOW)) { + if (!::wm::HasWindowVisibilityAnimationTransition( + window, ::wm::ANIMATE_SHOW)) { return false; } - switch (views::corewm::GetWindowVisibilityAnimationType(window)) { + switch (::wm::GetWindowVisibilityAnimationType(window)) { case WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE: AnimateShowWindow_Minimize(window); return true; @@ -251,12 +251,12 @@ bool AnimateShowWindow(aura::Window* window) { } bool AnimateHideWindow(aura::Window* window) { - if (!views::corewm::HasWindowVisibilityAnimationTransition( - window, views::corewm::ANIMATE_HIDE)) { + if (!::wm::HasWindowVisibilityAnimationTransition( + window, ::wm::ANIMATE_HIDE)) { return false; } - switch (views::corewm::GetWindowVisibilityAnimationType(window)) { + switch (::wm::GetWindowVisibilityAnimationType(window)) { case WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE: AnimateHideWindow_Minimize(window); return true; @@ -401,11 +401,11 @@ base::TimeDelta CrossFadeAnimation( } bool AnimateOnChildWindowVisibilityChanged(aura::Window* window, bool visible) { - if (views::corewm::WindowAnimationsDisabled(window)) + if (::wm::WindowAnimationsDisabled(window)) return false; // Attempt to run CoreWm supplied animation types. - if (views::corewm::AnimateOnChildWindowVisibilityChanged(window, visible)) + if (::wm::AnimateOnChildWindowVisibilityChanged(window, visible)) return true; // Otherwise try to run an Ash-specific animation. diff --git a/ash/wm/window_animations.h b/ash/wm/window_animations.h index fe76767..8d3e198 100644 --- a/ash/wm/window_animations.h +++ b/ash/wm/window_animations.h @@ -30,7 +30,7 @@ namespace ash { enum WindowVisibilityAnimationType { // Window scale/rotates down to its launcher icon. WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE = - views::corewm::WINDOW_VISIBILITY_ANIMATION_MAX, + ::wm::WINDOW_VISIBILITY_ANIMATION_MAX, // Fade in/out using brightness and grayscale web filters. WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE }; diff --git a/ash/wm/window_animations_unittest.cc b/ash/wm/window_animations_unittest.cc index a732956..91d7a76 100644 --- a/ash/wm/window_animations_unittest.cc +++ b/ash/wm/window_animations_unittest.cc @@ -71,7 +71,7 @@ TEST_F(WindowAnimationsTest, HideShowBrightnessGrayscaleAnimation) { EXPECT_TRUE(window->layer()->visible()); // Hiding. - views::corewm::SetWindowVisibilityAnimationType( + ::wm::SetWindowVisibilityAnimationType( window.get(), WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); AnimateOnChildWindowVisibilityChanged(window.get(), false); @@ -80,7 +80,7 @@ TEST_F(WindowAnimationsTest, HideShowBrightnessGrayscaleAnimation) { EXPECT_FALSE(window->layer()->visible()); // Showing. - views::corewm::SetWindowVisibilityAnimationType( + ::wm::SetWindowVisibilityAnimationType( window.get(), WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE); AnimateOnChildWindowVisibilityChanged(window.get(), true); diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index ac72def..d6672fe 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -665,7 +665,7 @@ TEST_F(WindowManagerTest, AdditionalFilters) { scoped_ptr<CustomEventHandler> f2(new CustomEventHandler); // Adds them to root window event filter. - views::corewm::CompoundEventFilter* env_filter = + ::wm::CompoundEventFilter* env_filter = Shell::GetInstance()->env_filter(); env_filter->AddHandler(f1.get()); env_filter->AddHandler(f2.get()); @@ -733,7 +733,7 @@ TEST_F(WindowManagerTest, AdditionalFilters) { // our internal tracking of the cursor state on ChromeOS (crbug.com/333952). TEST_F(WindowManagerTest, UpdateCursorVisibility) { aura::test::EventGenerator& generator = GetEventGenerator(); - views::corewm::CursorManager* cursor_manager = + ::wm::CursorManager* cursor_manager = ash::Shell::GetInstance()->cursor_manager(); generator.MoveMouseTo(gfx::Point(0, 0)); @@ -754,7 +754,7 @@ TEST_F(WindowManagerTest, UpdateCursorVisibility) { // (crbug.com/304296). TEST_F(WindowManagerTest, UpdateCursorVisibilityOnKeyEvent) { aura::test::EventGenerator& generator = GetEventGenerator(); - views::corewm::CursorManager* cursor_manager = + ::wm::CursorManager* cursor_manager = ash::Shell::GetInstance()->cursor_manager(); // Pressing a key hides the cursor but does not disable mouse events. @@ -777,7 +777,7 @@ TEST_F(WindowManagerTest, UpdateCursorVisibilityOnKeyEvent) { TEST_F(WindowManagerTest, TestCursorClientObserver) { aura::test::EventGenerator& generator = GetEventGenerator(); - views::corewm::CursorManager* cursor_manager = + ::wm::CursorManager* cursor_manager = ash::Shell::GetInstance()->cursor_manager(); scoped_ptr<aura::Window> w1(CreateTestWindowInShell( diff --git a/ash/wm/window_modality_controller_unittest.cc b/ash/wm/window_modality_controller_unittest.cc index d87326b..c829171 100644 --- a/ash/wm/window_modality_controller_unittest.cc +++ b/ash/wm/window_modality_controller_unittest.cc @@ -51,14 +51,14 @@ TEST_F(WindowModalityControllerTest, BasicActivation) { scoped_ptr<aura::Window> w12( CreateTestWindowInShellWithDelegate(&d, -12, gfx::Rect())); - views::corewm::AddTransientChild(w1.get(), w11.get()); + ::wm::AddTransientChild(w1.get(), w11.get()); wm::ActivateWindow(w1.get()); EXPECT_TRUE(wm::IsActiveWindow(w1.get())); wm::ActivateWindow(w11.get()); EXPECT_TRUE(wm::IsActiveWindow(w11.get())); w12->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); - views::corewm::AddTransientChild(w1.get(), w12.get()); + ::wm::AddTransientChild(w1.get(), w12.get()); wm::ActivateWindow(w12.get()); EXPECT_TRUE(wm::IsActiveWindow(w12.get())); @@ -98,8 +98,8 @@ TEST_F(WindowModalityControllerTest, NestedModals) { scoped_ptr<aura::Window> w2( CreateTestWindowInShellWithDelegate(&d, -2, gfx::Rect())); - views::corewm::AddTransientChild(w1.get(), w11.get()); - views::corewm::AddTransientChild(w11.get(), w111.get()); + ::wm::AddTransientChild(w1.get(), w11.get()); + ::wm::AddTransientChild(w11.get(), w111.get()); wm::ActivateWindow(w1.get()); EXPECT_TRUE(wm::IsActiveWindow(w1.get())); @@ -152,8 +152,8 @@ TEST_F(WindowModalityControllerTest, NestedModalsOuterClosed) { scoped_ptr<aura::Window> w2( CreateTestWindowInShellWithDelegate(&d, -2, gfx::Rect())); - views::corewm::AddTransientChild(w1.get(), w11.get()); - views::corewm::AddTransientChild(w11.get(), w111); + ::wm::AddTransientChild(w1.get(), w11.get()); + ::wm::AddTransientChild(w11.get(), w111); wm::ActivateWindow(w1.get()); EXPECT_TRUE(wm::IsActiveWindow(w1.get())); @@ -186,7 +186,7 @@ TEST_F(WindowModalityControllerTest, Events) { scoped_ptr<aura::Window> w11(CreateTestWindowInShellWithDelegate(&d, -11, gfx::Rect(20, 20, 50, 50))); - views::corewm::AddTransientChild(w1.get(), w11.get()); + ::wm::AddTransientChild(w1.get(), w11.get()); { // Clicking a point within w1 should activate that window. @@ -221,21 +221,21 @@ TEST_F(WindowModalityControllerTest, GetModalTransient) { w2->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); aura::Window* wt; - wt = views::corewm::GetModalTransient(w1.get()); + wt = ::wm::GetModalTransient(w1.get()); ASSERT_EQ(static_cast<aura::Window*>(NULL), wt); // Parent w2 to w1. It should get parented to the parent of w1. - views::corewm::AddTransientChild(w1.get(), w2.get()); + ::wm::AddTransientChild(w1.get(), w2.get()); ASSERT_EQ(2U, w1->parent()->children().size()); EXPECT_EQ(-2, w1->parent()->children().at(1)->id()); // Request the modal transient window for w1, it should be w2. - wt = views::corewm::GetModalTransient(w1.get()); + wt = ::wm::GetModalTransient(w1.get()); ASSERT_NE(static_cast<aura::Window*>(NULL), wt); EXPECT_EQ(-2, wt->id()); // Request the modal transient window for w11, it should also be w2. - wt = views::corewm::GetModalTransient(w11.get()); + wt = ::wm::GetModalTransient(w11.get()); ASSERT_NE(static_cast<aura::Window*>(NULL), wt); EXPECT_EQ(-2, wt->id()); } @@ -327,7 +327,7 @@ TEST_F(WindowModalityControllerTest, TouchEvent) { aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), gfx::Point(10, 10)); - views::corewm::AddTransientChild(w1.get(), w11.get()); + ::wm::AddTransientChild(w1.get(), w11.get()); d1.reset(); d11.reset(); @@ -516,7 +516,7 @@ TEST_F(WindowModalityControllerTest, WindowModalAncestor) { scoped_ptr<aura::Window> w4( CreateTestWindowInShellWithDelegate(&d, -2, gfx::Rect())); w4->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); - views::corewm::AddTransientChild(w1.get(), w4.get()); + ::wm::AddTransientChild(w1.get(), w4.get()); wm::ActivateWindow(w1.get()); EXPECT_TRUE(wm::IsActiveWindow(w4.get())); @@ -544,8 +544,8 @@ TEST_F(WindowModalityControllerTest, ChildModalAncestor) { scoped_ptr<aura::Window> w4( CreateTestWindowInShellWithDelegate(&d, -2, gfx::Rect())); w4->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_CHILD); - views::corewm::SetModalParent(w4.get(), w2.get()); - views::corewm::AddTransientChild(w1.get(), w4.get()); + ::wm::SetModalParent(w4.get(), w2.get()); + ::wm::AddTransientChild(w1.get(), w4.get()); wm::ActivateWindow(w1.get()); EXPECT_TRUE(wm::IsActiveWindow(w1.get())); diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc index a06ea47..56d3ac9 100644 --- a/ash/wm/window_positioner.cc +++ b/ash/wm/window_positioner.cc @@ -114,7 +114,7 @@ void SetBoundsAnimated(aura::Window* window, const gfx::Rect& bounds) { if (bounds == window->GetTargetBounds()) return; - if (views::corewm::WindowAnimationsDisabled(window)) { + if (::wm::WindowAnimationsDisabled(window)) { window->SetBounds(bounds); return; } diff --git a/ash/wm/window_state.cc b/ash/wm/window_state.cc index 8f69a36..b20682b 100644 --- a/ash/wm/window_state.cc +++ b/ash/wm/window_state.cc @@ -184,12 +184,12 @@ bool WindowState::CanResize() const { } bool WindowState::CanActivate() const { - return views::corewm::CanActivateWindow(window_); + return ::wm::CanActivateWindow(window_); } bool WindowState::CanSnap() const { if (!CanResize() || window_->type() == ui::wm::WINDOW_TYPE_PANEL || - views::corewm::GetTransientParent(window_)) + ::wm::GetTransientParent(window_)) return false; // If a window has a maximum size defined, snapping may make it too big. // TODO(oshima): We probably should snap if possible. @@ -392,7 +392,7 @@ void WindowState::SetBoundsDirectCrossFade(const gfx::Rect& new_bounds) { // Specify |set_bounds| to true here to keep the old bounds in the child // windows of |window|. scoped_ptr<ui::LayerTreeOwner> old_layer_owner = - views::corewm::RecreateLayers(window_); + ::wm::RecreateLayers(window_); ui::Layer* old_layer = old_layer_owner->root(); DCHECK(old_layer); ui::Layer* new_layer = window_->layer(); diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc index d37825e..a61b411 100644 --- a/ash/wm/window_util.cc +++ b/ash/wm/window_util.cc @@ -46,15 +46,15 @@ int GetDefaultSnappedWindowWidth(aura::Window* window) { // TODO(beng): replace many of these functions with the corewm versions. void ActivateWindow(aura::Window* window) { - views::corewm::ActivateWindow(window); + ::wm::ActivateWindow(window); } void DeactivateWindow(aura::Window* window) { - views::corewm::DeactivateWindow(window); + ::wm::DeactivateWindow(window); } bool IsActiveWindow(aura::Window* window) { - return views::corewm::IsActiveWindow(window); + return ::wm::IsActiveWindow(window); } aura::Window* GetActiveWindow() { @@ -63,11 +63,11 @@ aura::Window* GetActiveWindow() { } aura::Window* GetActivatableWindow(aura::Window* window) { - return views::corewm::GetActivatableWindow(window); + return ::wm::GetActivatableWindow(window); } bool CanActivateWindow(aura::Window* window) { - return views::corewm::CanActivateWindow(window); + return ::wm::CanActivateWindow(window); } bool IsWindowMinimized(aura::Window* window) { @@ -177,10 +177,10 @@ void ReparentTransientChildrenOfChild(aura::Window* child, aura::Window* old_parent, aura::Window* new_parent) { for (size_t i = 0; - i < views::corewm::GetTransientChildren(child).size(); + i < ::wm::GetTransientChildren(child).size(); ++i) { ReparentChildWithTransientChildren( - views::corewm::GetTransientChildren(child)[i], + ::wm::GetTransientChildren(child)[i], old_parent, new_parent); } diff --git a/ash/wm/workspace/multi_window_resize_controller.cc b/ash/wm/workspace/multi_window_resize_controller.cc index 36cebc21..df43914 100644 --- a/ash/wm/workspace/multi_window_resize_controller.cc +++ b/ash/wm/workspace/multi_window_resize_controller.cc @@ -100,7 +100,7 @@ class MultiWindowResizeController::ResizeView : public views::View { virtual gfx::NativeCursor GetCursor( const ui::MouseEvent& event) OVERRIDE { int component = (direction_ == LEFT_RIGHT) ? HTRIGHT : HTBOTTOM; - return views::corewm::CompoundEventFilter::CursorForWindowComponent( + return ::wm::CompoundEventFilter::CursorForWindowComponent( component); } @@ -393,9 +393,9 @@ void MultiWindowResizeController::ShowNow() { ResizeView* view = new ResizeView(this, windows_.direction); resize_widget_->set_focus_on_creation(false); resize_widget_->Init(params); - views::corewm::SetWindowVisibilityAnimationType( + ::wm::SetWindowVisibilityAnimationType( resize_widget_->GetNativeWindow(), - views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); resize_widget_->GetNativeWindow()->SetName("MultiWindowResizeController"); resize_widget_->SetContentsView(view); show_bounds_in_screen_ = ScreenUtil::ConvertRectToScreen( diff --git a/ash/wm/workspace/workspace_event_handler_unittest.cc b/ash/wm/workspace/workspace_event_handler_unittest.cc index 62a48c9..de17d09 100644 --- a/ash/wm/workspace/workspace_event_handler_unittest.cc +++ b/ash/wm/workspace/workspace_event_handler_unittest.cc @@ -290,7 +290,7 @@ TEST_F(WorkspaceEventHandlerTest, wd1.set_window_component(HTCAPTION); child->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); - views::corewm::AddTransientChild(window.get(), child.get()); + ::wm::AddTransientChild(window.get(), child.get()); wm::WindowState* window_state = wm::GetWindowState(window.get()); EXPECT_FALSE(window_state->IsMaximized()); diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc index 3ff0411..1765b09 100644 --- a/ash/wm/workspace/workspace_layout_manager_unittest.cc +++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc @@ -338,7 +338,7 @@ TEST_F(WorkspaceLayoutManagerTest, DontClobberRestoreBounds) { scoped_ptr<aura::Window> window2( CreateTestWindowInShellWithBounds(gfx::Rect(12, 20, 30, 40))); - views::corewm::AddTransientChild(window.get(), window2.get()); + ::wm::AddTransientChild(window.get(), window2.get()); window2->Show(); window_observer.set_window(window2.get()); diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc index 1b481a5..6223de3 100644 --- a/ash/wm/workspace/workspace_window_resizer.cc +++ b/ash/wm/workspace/workspace_window_resizer.cc @@ -99,7 +99,7 @@ scoped_ptr<WindowResizer> CreateWindowResizer( window_resizer = PanelWindowResizer::Create(window_resizer, window_state); if (switches::UseDockedWindows() && window_resizer && window->parent() && - !views::corewm::GetTransientParent(window) && + !::wm::GetTransientParent(window) && (window->parent()->id() == internal::kShellWindowId_DefaultContainer || window->parent()->id() == internal::kShellWindowId_DockedContainer || window->parent()->id() == internal::kShellWindowId_PanelContainer)) { diff --git a/ash/wm/workspace_controller.cc b/ash/wm/workspace_controller.cc index 6dedf17..d7cb7aa 100644 --- a/ash/wm/workspace_controller.cc +++ b/ash/wm/workspace_controller.cc @@ -45,7 +45,7 @@ WorkspaceController::WorkspaceController(aura::Window* viewport) event_handler_(new WorkspaceEventHandler), layout_manager_(new WorkspaceLayoutManager(viewport)) { SetWindowVisibilityAnimationTransition( - viewport_, views::corewm::ANIMATE_NONE); + viewport_, ::wm::ANIMATE_NONE); viewport_->SetLayoutManager(layout_manager_); viewport_->AddPreTargetHandler(event_handler_.get()); diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc index df05ed6..0438c83 100644 --- a/ash/wm/workspace_controller_unittest.cc +++ b/ash/wm/workspace_controller_unittest.cc @@ -703,7 +703,7 @@ TEST_F(WorkspaceControllerTest, TransientParent) { // Window with a transient parent. We set the transient parent to the root, // which would never happen but is enough to exercise the bug. scoped_ptr<Window> w1(CreateTestWindowUnparented()); - views::corewm::AddTransientChild( + ::wm::AddTransientChild( Shell::GetInstance()->GetPrimaryRootWindow(), w1.get()); w1->SetBounds(gfx::Rect(10, 11, 250, 251)); ParentWindowInPrimaryRootWindow(w1.get()); @@ -1159,7 +1159,7 @@ TEST_F(WorkspaceControllerTest, VerifyLayerOrdering) { ui::wm::WINDOW_TYPE_POPUP, gfx::Rect(5, 6, 7, 8), NULL); - views::corewm::AddTransientChild(browser.get(), status_bubble); + ::wm::AddTransientChild(browser.get(), status_bubble); ParentWindowInPrimaryRootWindow(status_bubble); status_bubble->SetName("status_bubble"); diff --git a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc index 69c285f..81b53b6 100644 --- a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc +++ b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc @@ -47,7 +47,7 @@ class UserWallpaperDelegate : public ash::UserWallpaperDelegate { virtual int GetAnimationType() OVERRIDE { return ShouldShowInitialAnimation() ? ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE : - static_cast<int>(views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + static_cast<int>(wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); } virtual int GetAnimationDurationOverride() OVERRIDE { diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index 2968028..222ac81 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -197,7 +197,7 @@ std::string DeriveCommandLine(const GURL& start_url, ::switches::kEnableBrowserTextSubpixelPositioning, ::switches::kEnableWebkitTextSubpixelPositioning, policy::switches::kDeviceManagementUrl, - views::corewm::switches::kWindowAnimationsDisabled, + wm::switches::kWindowAnimationsDisabled, }; command_line->CopySwitchesFrom(base_command_line, kForwardSwitches, diff --git a/chrome/browser/chromeos/login/lock_window_aura.cc b/chrome/browser/chromeos/login/lock_window_aura.cc index 01bf843..447fa69 100644 --- a/chrome/browser/chromeos/login/lock_window_aura.cc +++ b/chrome/browser/chromeos/login/lock_window_aura.cc @@ -54,8 +54,8 @@ void LockWindowAura::Init() { ash::Shell::GetPrimaryRootWindow(), ash::internal::kShellWindowId_LockScreenContainer); views::Widget::Init(params); - views::corewm::SetWindowVisibilityAnimationTransition( - GetNativeView(), views::corewm::ANIMATE_NONE); + wm::SetWindowVisibilityAnimationTransition( + GetNativeView(), wm::ANIMATE_NONE); } } // namespace chromeos diff --git a/chrome/browser/chromeos/login/login_display_host_impl.cc b/chrome/browser/chromeos/login/login_display_host_impl.cc index 1b05a4a..a837c35 100644 --- a/chrome/browser/chromeos/login/login_display_host_impl.cc +++ b/chrome/browser/chromeos/login/login_display_host_impl.cc @@ -991,12 +991,12 @@ void LoginDisplayHostImpl::InitLoginWindowAndView() { if (login_view_->webui_visible()) OnLoginPromptVisible(); - views::corewm::SetWindowVisibilityAnimationDuration( + wm::SetWindowVisibilityAnimationDuration( login_window_->GetNativeView(), base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); - views::corewm::SetWindowVisibilityAnimationTransition( + wm::SetWindowVisibilityAnimationTransition( login_window_->GetNativeView(), - views::corewm::ANIMATE_HIDE); + wm::ANIMATE_HIDE); login_window_->SetContentsView(login_view_); diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc index 1e0c61a..cf22b70 100644 --- a/chrome/browser/chromeos/login/user_manager_impl.cc +++ b/chrome/browser/chromeos/login/user_manager_impl.cc @@ -1477,7 +1477,7 @@ void UserManagerImpl::KioskAppLoggedIn(const std::string& app_id) { // Disable window animation since kiosk app runs in a single full screen // window and window animation causes start-up janks. command_line->AppendSwitch( - views::corewm::switches::kWindowAnimationsDisabled); + wm::switches::kWindowAnimationsDisabled); } void UserManagerImpl::DemoAccountLoggedIn() { @@ -1489,7 +1489,7 @@ void UserManagerImpl::DemoAccountLoggedIn() { // Disable window animation since the demo app runs in a single full screen // window and window animation causes start-up janks. CommandLine::ForCurrentProcess()->AppendSwitch( - views::corewm::switches::kWindowAnimationsDisabled); + wm::switches::kWindowAnimationsDisabled); } void UserManagerImpl::RetailModeUserLoggedIn() { diff --git a/chrome/browser/notifications/desktop_notifications_unittest.cc b/chrome/browser/notifications/desktop_notifications_unittest.cc index bc8c568..fef46d5 100644 --- a/chrome/browser/notifications/desktop_notifications_unittest.cc +++ b/chrome/browser/notifications/desktop_notifications_unittest.cc @@ -108,7 +108,7 @@ DesktopNotificationsTest::~DesktopNotificationsTest() { void DesktopNotificationsTest::SetUp() { ui::InitializeInputMethodForTesting(); #if defined(USE_AURA) - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); #endif #if defined(USE_ASH) ui::ScopedAnimationDurationScaleMode normal_duration_mode( diff --git a/chrome/browser/notifications/desktop_notifications_unittest.h b/chrome/browser/notifications/desktop_notifications_unittest.h index 6ecd01e..47eaf77 100644 --- a/chrome/browser/notifications/desktop_notifications_unittest.h +++ b/chrome/browser/notifications/desktop_notifications_unittest.h @@ -22,11 +22,9 @@ #include "testing/gtest/include/gtest/gtest.h" #if defined(USE_AURA) -namespace views { -namespace corewm { +namespace wm { class WMState; } -} #endif class ActiveDesktopMonitor; @@ -132,7 +130,7 @@ class DesktopNotificationsTest : public testing::Test { private: #if defined(USE_AURA) - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; #endif DISALLOW_COPY_AND_ASSIGN(DesktopNotificationsTest); diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc index 7faf301..769900b4 100644 --- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc @@ -342,7 +342,7 @@ bool AppShortcutLauncherItemController::AdvanceToNextApp() { // If there is only a single item available, we animate it upon key // action. AnimateWindow(browser->window()->GetNativeWindow(), - views::corewm::WINDOW_ANIMATION_TYPE_BOUNCE); + wm::WINDOW_ANIMATION_TYPE_BOUNCE); } else { int index = (static_cast<int>(i - items.begin()) + 1) % items.size(); ActivateContent(items[index]); diff --git a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc index 46931ec..14d80ec 100644 --- a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc @@ -281,7 +281,7 @@ void AppWindowLauncherItemController::ActivateOrAdvanceToNextAppWindow( // Coming here, only a single window is active. For keyboard activations // the window gets animated. AnimateWindow(window_to_show->GetNativeWindow(), - views::corewm::WINDOW_ANIMATION_TYPE_BOUNCE); + wm::WINDOW_ANIMATION_TYPE_BOUNCE); } else { ShowAndActivateOrMinimize(window_to_show); } diff --git a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc index 4e79e42..7be61c9 100644 --- a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc @@ -289,7 +289,7 @@ void BrowserShortcutLauncherItemController::ActivateOrAdvanceToNextBrowser() { // bounce it (if it is already active). if (browser == items[0]) { AnimateWindow(browser->window()->GetNativeWindow(), - views::corewm::WINDOW_ANIMATION_TYPE_BOUNCE); + wm::WINDOW_ANIMATION_TYPE_BOUNCE); return; } browser = items[0]; diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index 2c24419..0c02c69 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc @@ -1066,7 +1066,7 @@ void ChromeLauncherController::ActivateWindowOrMinimizeIfActive( if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableMinimizeOnSecondLauncherItemClick)) { AnimateWindow(window->GetNativeWindow(), - views::corewm::WINDOW_ANIMATION_TYPE_BOUNCE); + wm::WINDOW_ANIMATION_TYPE_BOUNCE); } else { window->Minimize(); } diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc index a77631a..ef6c5c9 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc @@ -155,21 +155,21 @@ class AnimationSetter { AnimationSetter(aura::Window* window, int animation_time_in_ms) : window_(window), previous_animation_type_( - views::corewm::GetWindowVisibilityAnimationType(window_)), + wm::GetWindowVisibilityAnimationType(window_)), previous_animation_time_( - views::corewm::GetWindowVisibilityAnimationDuration(*window_)) { - views::corewm::SetWindowVisibilityAnimationType( + wm::GetWindowVisibilityAnimationDuration(*window_)) { + wm::SetWindowVisibilityAnimationType( window_, - views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); - views::corewm::SetWindowVisibilityAnimationDuration( + wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + wm::SetWindowVisibilityAnimationDuration( window_, base::TimeDelta::FromMilliseconds(animation_time_in_ms)); } ~AnimationSetter() { - views::corewm::SetWindowVisibilityAnimationType(window_, + wm::SetWindowVisibilityAnimationType(window_, previous_animation_type_); - views::corewm::SetWindowVisibilityAnimationDuration( + wm::SetWindowVisibilityAnimationDuration( window_, previous_animation_time_); } @@ -296,7 +296,7 @@ void MultiUserWindowManagerChromeOS::SetWindowOwner( // Add observers to track state changes. window->AddObserver(this); - views::corewm::TransientWindowManager::Get(window)->AddObserver(this); + wm::TransientWindowManager::Get(window)->AddObserver(this); // Check if this window was created due to a user interaction. If it was, // transfer it to the current user. @@ -443,7 +443,7 @@ void MultiUserWindowManagerChromeOS::OnWindowDestroyed(aura::Window* window) { RemoveTransientOwnerRecursive(window); return; } - views::corewm::TransientWindowManager::Get(window)->RemoveObserver(this); + wm::TransientWindowManager::Get(window)->RemoveObserver(this); // Remove the window from the owners list. delete window_to_entry_[window]; window_to_entry_.erase(window); @@ -768,8 +768,8 @@ void MultiUserWindowManagerChromeOS::SetWindowVisibility( void MultiUserWindowManagerChromeOS::ShowWithTransientChildrenRecursive( aura::Window* window, int animation_time_in_ms) { aura::Window::Windows::const_iterator it = - views::corewm::GetTransientChildren(window).begin(); - for (; it != views::corewm::GetTransientChildren(window).end(); ++it) + wm::GetTransientChildren(window).begin(); + for (; it != wm::GetTransientChildren(window).end(); ++it) ShowWithTransientChildrenRecursive(*it, animation_time_in_ms); // We show all children which were not explicitly hidden. @@ -783,11 +783,11 @@ aura::Window* MultiUserWindowManagerChromeOS::GetOwningWindowInTransientChain( aura::Window* window) { if (!GetWindowOwner(window).empty()) return NULL; - aura::Window* parent = views::corewm::GetTransientParent(window); + aura::Window* parent = wm::GetTransientParent(window); while (parent) { if (!GetWindowOwner(parent).empty()) return parent; - parent = views::corewm::GetTransientParent(parent); + parent = wm::GetTransientParent(parent); } return NULL; } @@ -797,8 +797,8 @@ void MultiUserWindowManagerChromeOS::AddTransientOwnerRecursive( aura::Window* owned_parent) { // First add all child windows. aura::Window::Windows::const_iterator it = - views::corewm::GetTransientChildren(window).begin(); - for (; it != views::corewm::GetTransientChildren(window).end(); ++it) + wm::GetTransientChildren(window).begin(); + for (; it != wm::GetTransientChildren(window).end(); ++it) AddTransientOwnerRecursive(*it, owned_parent); // If this window is the owned window, we do not have to handle it again. @@ -812,7 +812,7 @@ void MultiUserWindowManagerChromeOS::AddTransientOwnerRecursive( // Add observers to track state changes. window->AddObserver(this); - views::corewm::TransientWindowManager::Get(window)->AddObserver(this); + wm::TransientWindowManager::Get(window)->AddObserver(this); // Hide the window if it should not be shown. Note that this hide operation // will hide recursively this and all children - but we have already collected @@ -825,8 +825,8 @@ void MultiUserWindowManagerChromeOS::RemoveTransientOwnerRecursive( aura::Window* window) { // First remove all child windows. aura::Window::Windows::const_iterator it = - views::corewm::GetTransientChildren(window).begin(); - for (; it != views::corewm::GetTransientChildren(window).end(); ++it) + wm::GetTransientChildren(window).begin(); + for (; it != wm::GetTransientChildren(window).end(); ++it) RemoveTransientOwnerRecursive(*it); // Find from transient window storage the visibility for the given window, @@ -836,7 +836,7 @@ void MultiUserWindowManagerChromeOS::RemoveTransientOwnerRecursive( DCHECK(visibility_item != transient_window_to_visibility_.end()); window->RemoveObserver(this); - views::corewm::TransientWindowManager::Get(window)->RemoveObserver(this); + wm::TransientWindowManager::Get(window)->RemoveObserver(this); bool unowned_view_state = visibility_item->second; transient_window_to_visibility_.erase(visibility_item); diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h index e334283..edd839c 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h @@ -56,7 +56,7 @@ class MultiUserWindowManagerChromeOS public ash::SessionStateObserver, public aura::WindowObserver, public content::NotificationObserver, - public views::corewm::TransientWindowObserver { + public wm::TransientWindowObserver { public: // Create the manager and use |active_user_id| as the active user. explicit MultiUserWindowManagerChromeOS(const std::string& active_user_id); diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc index 7f55945..e5144a4 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc @@ -520,15 +520,15 @@ TEST_F(MultiUserWindowManagerChromeOSTest, TransientWindows) { // 3 - .. multi_user_window_manager()->SetWindowOwner(window(0), "A"); multi_user_window_manager()->SetWindowOwner(window(4), "B"); - views::corewm::AddTransientChild(window(0), window(1)); + wm::AddTransientChild(window(0), window(1)); // We first attach 2->3 and then 1->2 to see that the ownership gets // properly propagated through the sub tree upon assigning. - views::corewm::AddTransientChild(window(2), window(3)); - views::corewm::AddTransientChild(window(1), window(2)); - views::corewm::AddTransientChild(window(4), window(5)); - views::corewm::AddTransientChild(window(4), window(6)); - views::corewm::AddTransientChild(window(7), window(8)); - views::corewm::AddTransientChild(window(7), window(9)); + wm::AddTransientChild(window(2), window(3)); + wm::AddTransientChild(window(1), window(2)); + wm::AddTransientChild(window(4), window(5)); + wm::AddTransientChild(window(4), window(6)); + wm::AddTransientChild(window(7), window(8)); + wm::AddTransientChild(window(7), window(9)); // By now the hierarchy should have updated itself to show all windows of A // and hide all windows of B. Unowned windows should remain in what ever state @@ -565,15 +565,15 @@ TEST_F(MultiUserWindowManagerChromeOSTest, TransientWindows) { // 1 5 8 // | // 9 - views::corewm::RemoveTransientChild(window(2), window(3)); - views::corewm::RemoveTransientChild(window(4), window(6)); + wm::RemoveTransientChild(window(2), window(3)); + wm::RemoveTransientChild(window(4), window(6)); EXPECT_EQ("S[A], S[], H[], H[], H[B], H[], S[], S[], S[], H[]", GetStatus()); // Before we leave we need to reverse all transient window ownerships. - views::corewm::RemoveTransientChild(window(0), window(1)); - views::corewm::RemoveTransientChild(window(1), window(2)); - views::corewm::RemoveTransientChild(window(4), window(5)); - views::corewm::RemoveTransientChild(window(7), window(8)); - views::corewm::RemoveTransientChild(window(7), window(9)); + wm::RemoveTransientChild(window(0), window(1)); + wm::RemoveTransientChild(window(1), window(2)); + wm::RemoveTransientChild(window(4), window(5)); + wm::RemoveTransientChild(window(7), window(8)); + wm::RemoveTransientChild(window(7), window(9)); } // Test that the initial visibility state gets remembered. diff --git a/chrome/browser/ui/ash/user_wallpaper_delegate_win.cc b/chrome/browser/ui/ash/user_wallpaper_delegate_win.cc index 6a83c60..2c040bd 100644 --- a/chrome/browser/ui/ash/user_wallpaper_delegate_win.cc +++ b/chrome/browser/ui/ash/user_wallpaper_delegate_win.cc @@ -27,7 +27,7 @@ class UserWallpaperDelegate : public ash::UserWallpaperDelegate { virtual int GetAnimationType() OVERRIDE { return ShouldShowInitialAnimation() ? ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE : - static_cast<int>(views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); + static_cast<int>(wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); } virtual bool ShouldShowInitialAnimation() OVERRIDE { diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc index e75277b..905ca82 100644 --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc @@ -24,7 +24,7 @@ #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/widget/widget.h" -#include "ui/wm/public/easy_resize_window_targeter.h" +#include "ui/wm/core/easy_resize_window_targeter.h" #if defined(OS_LINUX) #include "chrome/browser/shell_integration_linux.h" diff --git a/chrome/browser/ui/views/apps/shaped_app_window_targeter.h b/chrome/browser/ui/views/apps/shaped_app_window_targeter.h index 1cd6840..da0c2b8 100644 --- a/chrome/browser/ui/views/apps/shaped_app_window_targeter.h +++ b/chrome/browser/ui/views/apps/shaped_app_window_targeter.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_VIEWS_APPS_SHAPED_APP_WINDOW_TARGETER_H_ #define CHROME_BROWSER_UI_VIEWS_APPS_SHAPED_APP_WINDOW_TARGETER_H_ -#include "ui/wm/public/masked_window_targeter.h" +#include "ui/wm/core/masked_window_targeter.h" class ChromeNativeAppWindowViews; diff --git a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc index 1bfc553..3d8879d 100644 --- a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc +++ b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc @@ -9,7 +9,7 @@ #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/views/controls/webview/webview.h" -#include "ui/wm/public/easy_resize_window_targeter.h" +#include "ui/wm/core/easy_resize_window_targeter.h" class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase { public: diff --git a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc index c608701..6d98744 100644 --- a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc +++ b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc @@ -58,8 +58,8 @@ void AutofillPopupBaseView::DoShow() { widget->SetContentsView(this); #if defined(USE_AURA) // No animation for popup appearance (too distracting). - views::corewm::SetWindowVisibilityAnimationTransition( - widget->GetNativeView(), views::corewm::ANIMATE_HIDE); + wm::SetWindowVisibilityAnimationTransition( + widget->GetNativeView(), wm::ANIMATE_HIDE); #endif } diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc index 3a48cf4..08dda79 100644 --- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc +++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc @@ -26,6 +26,6 @@ void ChromeBrowserMainExtraPartsViews::ToolkitInitialized() { views::ViewsDelegate::views_delegate = new ChromeViewsDelegate; #if defined(USE_AURA) - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); #endif } diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h index bb0a573..421ba44 100644 --- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h +++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h @@ -11,11 +11,9 @@ #include "chrome/browser/chrome_browser_main_extra_parts.h" #if defined(USE_AURA) -namespace views { -namespace corewm { +namespace wm { class WMState; } -} #endif class ChromeBrowserMainExtraPartsViews : public ChromeBrowserMainExtraParts { @@ -28,7 +26,7 @@ class ChromeBrowserMainExtraPartsViews : public ChromeBrowserMainExtraParts { private: #if defined(USE_AURA) - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; #endif DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsViews); diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc index 939b2cc..e8a31ab 100644 --- a/chrome/browser/ui/views/extensions/extension_popup.cc +++ b/chrome/browser/ui/views/extensions/extension_popup.cc @@ -198,7 +198,7 @@ void ExtensionPopup::OnWindowActivated(aura::Window* gained_active, if (!inspect_with_devtools_ && anchor_window == gained_active && host_desktop_type != chrome::HOST_DESKTOP_TYPE_ASH && this_window->GetRootWindow() == anchor_window->GetRootWindow() && - views::corewm::GetTransientParent(gained_active) != this_window) + wm::GetTransientParent(gained_active) != this_window) GetWidget()->Close(); } #endif @@ -224,10 +224,10 @@ ExtensionPopup* ExtensionPopup::ShowPopup(const GURL& url, #if defined(USE_AURA) gfx::NativeView native_view = popup->GetWidget()->GetNativeView(); - views::corewm::SetWindowVisibilityAnimationType( + wm::SetWindowVisibilityAnimationType( native_view, - views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); - views::corewm::SetWindowVisibilityAnimationVerticalPosition( + wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); + wm::SetWindowVisibilityAnimationVerticalPosition( native_view, -3.0f); #endif diff --git a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc index ced62df..b114390 100644 --- a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc +++ b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc @@ -67,10 +67,10 @@ void DesktopBrowserFrameAura::InitNativeWidget( browser_desktop_window_tree_host_->AsDesktopWindowTreeHost(); DesktopNativeWidgetAura::InitNativeWidget(modified_params); - visibility_controller_.reset(new views::corewm::VisibilityController); + visibility_controller_.reset(new wm::VisibilityController); aura::client::SetVisibilityClient(GetNativeView()->GetRootWindow(), visibility_controller_.get()); - views::corewm::SetChildWindowVisibilityChangesAnimated( + wm::SetChildWindowVisibilityChangesAnimated( GetNativeView()->GetRootWindow()); } diff --git a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h index ec782b9..66f3da2 100644 --- a/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h +++ b/chrome/browser/ui/views/frame/desktop_browser_frame_aura.h @@ -15,11 +15,9 @@ class BrowserDesktopWindowTreeHost; class BrowserFrame; class BrowserView; -namespace views { -namespace corewm { +namespace wm { class VisibilityController; } -} //////////////////////////////////////////////////////////////////////////////// // DesktopBrowserFrameAura @@ -57,7 +55,7 @@ class DesktopBrowserFrameAura : public views::DesktopNativeWidgetAura, // Owned by the RootWindow. BrowserDesktopWindowTreeHost* browser_desktop_window_tree_host_; - scoped_ptr<views::corewm::VisibilityController> visibility_controller_; + scoped_ptr<wm::VisibilityController> visibility_controller_; DISALLOW_COPY_AND_ASSIGN(DesktopBrowserFrameAura); }; diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc index 718a004..f075833 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc @@ -223,8 +223,8 @@ void OmniboxPopupContentsView::UpdatePopupAppearance() { if (!popup_.get()) return; #if defined(USE_AURA) - views::corewm::SetWindowVisibilityAnimationTransition( - popup_->GetNativeView(), views::corewm::ANIMATE_NONE); + wm::SetWindowVisibilityAnimationTransition( + popup_->GetNativeView(), wm::ANIMATE_NONE); #endif popup_->SetContentsView(this); popup_->StackAbove(omnibox_view_->GetRelativeWindowForPopup()); diff --git a/chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc b/chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc index 1c8dfb7..f01c7bb 100644 --- a/chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc +++ b/chrome/browser/ui/views/web_contents_modal_dialog_manager_views.cc @@ -77,21 +77,21 @@ class NativeWebContentsModalDialogManagerViews widget->GetNativeWindow()->SetProperty(aura::client::kConstrainedWindowKey, true); - views::corewm::SetWindowVisibilityAnimationType( + wm::SetWindowVisibilityAnimationType( widget->GetNativeWindow(), - views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE); + wm::WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE); #endif #if defined(USE_ASH) gfx::NativeView parent = platform_util::GetParent(widget->GetNativeView()); - views::corewm::SetChildWindowVisibilityChangesAnimated(parent); + wm::SetChildWindowVisibilityChangesAnimated(parent); // No animations should get performed on the window since that will re-order // the window stack which will then cause many problems. if (parent && parent->parent()) { parent->parent()->SetProperty(aura::client::kAnimationsDisabledKey, true); } - views::corewm::SetModalParent( + wm::SetModalParent( widget->GetNativeWindow(), platform_util::GetParent(widget->GetNativeView())); #endif @@ -100,9 +100,9 @@ class NativeWebContentsModalDialogManagerViews virtual void ShowDialog(NativeWebContentsModalDialog dialog) OVERRIDE { views::Widget* widget = GetWidget(dialog); #if defined(USE_AURA) - scoped_ptr<views::corewm::SuspendChildWindowVisibilityAnimations> suspend; + scoped_ptr<wm::SuspendChildWindowVisibilityAnimations> suspend; if (shown_widgets_.find(widget) != shown_widgets_.end()) { - suspend.reset(new views::corewm::SuspendChildWindowVisibilityAnimations( + suspend.reset(new wm::SuspendChildWindowVisibilityAnimations( widget->GetNativeWindow()->parent())); } #endif @@ -123,8 +123,8 @@ class NativeWebContentsModalDialogManagerViews virtual void HideDialog(NativeWebContentsModalDialog dialog) OVERRIDE { views::Widget* widget = GetWidget(dialog); #if defined(USE_AURA) - scoped_ptr<views::corewm::SuspendChildWindowVisibilityAnimations> suspend; - suspend.reset(new views::corewm::SuspendChildWindowVisibilityAnimations( + scoped_ptr<wm::SuspendChildWindowVisibilityAnimations> suspend; + suspend.reset(new wm::SuspendChildWindowVisibilityAnimations( widget->GetNativeWindow()->parent())); #endif widget->Hide(); diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi index 49105b8..ec5a5e5 100644 --- a/chrome/chrome_browser_ui.gypi +++ b/chrome/chrome_browser_ui.gypi @@ -2812,6 +2812,7 @@ }], ['toolkit_views == 1', { 'dependencies': [ + '../ui/wm/wm.gyp:wm_core', '../ui/wm/wm.gyp:wm_public', ], 'sources!': [ diff --git a/chrome/test/base/test_launcher_utils.cc b/chrome/test/base/test_launcher_utils.cc index 0bf1e28..50c2cae 100644 --- a/chrome/test/base/test_launcher_utils.cc +++ b/chrome/test/base/test_launcher_utils.cc @@ -52,7 +52,7 @@ void PrepareBrowserCommandLineForTests(CommandLine* command_line) { // Disable window animations under Ash as the animations effect the // coordinates returned and result in flake. command_line->AppendSwitch( - views::corewm::switches::kWindowAnimationsDisabled); + wm::switches::kWindowAnimationsDisabled); #endif #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_CHROMEOS) diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc index 8ef02b5..d8a1140 100644 --- a/chrome/test/base/view_event_test_base.cc +++ b/chrome/test/base/view_event_test_base.cc @@ -96,7 +96,7 @@ void ViewEventTestBase::Done() { void ViewEventTestBase::SetUp() { #if defined(USE_AURA) - wm_state_.reset(new views::corewm::WMState); + wm_state_.reset(new wm::WMState); #endif views::ViewsDelegate::views_delegate = &views_delegate_; diff --git a/chrome/test/base/view_event_test_base.h b/chrome/test/base/view_event_test_base.h index 397c9ad..8c7e686 100644 --- a/chrome/test/base/view_event_test_base.h +++ b/chrome/test/base/view_event_test_base.h @@ -34,11 +34,9 @@ namespace gfx { class Size; } -namespace views { -namespace corewm { +namespace wm { class WMState; } -} // Base class for Views based tests that dispatch events. // @@ -156,7 +154,7 @@ class ViewEventTestBase : public views::WidgetDelegate, #if defined(USE_AURA) scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; - scoped_ptr<views::corewm::WMState> wm_state_; + scoped_ptr<wm::WMState> wm_state_; #endif ChromeViewsDelegate views_delegate_; diff --git a/content/content_shell.gypi b/content/content_shell.gypi index 9996401..22f685a 100644 --- a/content/content_shell.gypi +++ b/content/content_shell.gypi @@ -337,6 +337,7 @@ '../ui/views/controls/webview/webview.gyp:webview', '../ui/views/views.gyp:views', '../ui/views/views.gyp:views_test_support', + '../ui/wm/wm.gyp:wm_core', ], 'sources/': [ ['exclude', 'shell/browser/shell_aura.cc'], diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index f53a8293f..f54e648 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json @@ -22,6 +22,7 @@ "sandbox_linux_unittests", "ui_unittests", "views_unittests", + "wm_core_unittests", "aura_unittests", "ash_unittests", "app_list_unittests", @@ -63,6 +64,7 @@ "sandbox_linux_unittests", "ui_unittests", "views_unittests", + "wm_core_unittests", "aura_unittests", "ash_unittests", "app_list_unittests", diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index c748849..6616686 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json @@ -33,6 +33,7 @@ "sync_unit_tests", "unit_tests", "views_unittests", + "wm_core_unittests", "sql_unittests", "browser_tests", "content_browsertests", @@ -130,6 +131,7 @@ "sync_unit_tests", "unit_tests", "views_unittests", + "wm_core_unittests", "sql_unittests", "webkit_compositor_bindings_unittests", "mojo_apps_js_unittests", @@ -183,6 +185,7 @@ "sync_unit_tests", "unit_tests", "views_unittests", + "wm_core_unittests", "sql_unittests", "webkit_compositor_bindings_unittests", "mojo_apps_js_unittests", diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index b630877..11e695d0 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json @@ -31,6 +31,7 @@ "base_unittests", "net_unittests", "views_unittests", + "wm_core_unittests", "aura_unittests", "ash_unittests", "compositor_unittests", @@ -50,6 +51,7 @@ "ui_unittests", "content_unittests", "views_unittests", + "wm_core_unittests", {"test": "browser_tests", "shard_index": 2, "total_shards": 3} ] }, @@ -85,6 +87,7 @@ "base_unittests", "net_unittests", "views_unittests", + "wm_core_unittests", "aura_unittests", "ash_unittests", "compositor_unittests", @@ -104,6 +107,7 @@ "ui_unittests", "content_unittests", "views_unittests", + "wm_core_unittests", {"test": "browser_tests", "shard_index": 2, "total_shards": 3} ] }, @@ -139,6 +143,7 @@ "base_unittests", "net_unittests", "views_unittests", + "wm_core_unittests", "aura_unittests", "ash_unittests", "compositor_unittests", @@ -158,6 +163,7 @@ "ui_unittests", "content_unittests", "views_unittests", + "wm_core_unittests", {"test": "browser_tests", "shard_index": 2, "total_shards": 3} ] }, @@ -202,6 +208,7 @@ "content_unittests", "ui_unittests", "views_unittests", + "wm_core_unittests", "ipc_tests", "sync_unit_tests", "unit_tests", @@ -238,6 +245,7 @@ "ui_unittests", "content_unittests", "views_unittests", + "wm_core_unittests", "installer_util_unittests", "webkit_compositor_bindings_unittests" ] @@ -280,6 +288,7 @@ "Win8 Aura": { "gtest_tests": [ "views_unittests", + "wm_core_unittests", "aura_unittests", "ash_unittests", "compositor_unittests", 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 55e46a6..56078cd 100644 --- a/ui/views/examples/examples_main.cc +++ b/ui/views/examples/examples_main.cc @@ -59,7 +59,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..22ae9c1 100644 --- a/ui/views/views.gyp +++ b/ui/views/views.gyp @@ -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', @@ -644,6 +601,7 @@ '../resources/ui_resources.gyp:ui_resources', '../resources/ui_resources.gyp:ui_test_pak', '../ui_unittests.gyp:ui_test_support', + '../wm/wm.gyp:wm_core', '../wm/wm.gyp:wm_public', '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..f873509 100644 --- a/ui/wm/public/easy_resize_window_targeter.h +++ b/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 d97bf03..d66846c 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: @@ -71,5 +70,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..ad3140d3 100644 --- a/ui/wm/public/masked_window_targeter.h +++ b/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..1670428 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', + '../ui.gyp:ui', + ], + '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', + '../ui.gyp:ui', + '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', + ], + }, ], } |