Skip to content

Commit

Permalink
Move wm/core to wm namespace.
Browse files Browse the repository at this point in the history
Also sets up new targets for wm_core, wm_core_unittests, etc.

[email protected]
[email protected]
BUG=

Review URL: https://codereview.chromium.org/196063002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256680 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
[email protected] committed Mar 12, 2014
1 parent 436e890 commit 067d7fe
Show file tree
Hide file tree
Showing 200 changed files with 753 additions and 765 deletions.
2 changes: 1 addition & 1 deletion ash/accelerators/accelerator_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
3 changes: 3 additions & 0 deletions ash/ash.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -1063,6 +1065,7 @@
'../ui/message_center/message_center.gyp:message_center',
'../ui/resources/ui_resources.gyp:ui_resources',
'../ui/ui.gyp:ui',
'../ui/wm/wm.gyp:wm_core',
'../ui/views/views.gyp:views',
'../ui/views/views.gyp:views_examples_lib',
'../ui/views/views.gyp:views_examples_with_content_lib',
Expand Down
2 changes: 1 addition & 1 deletion ash/default_user_wallpaper_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
12 changes: 6 additions & 6 deletions ash/desktop_background/desktop_background_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions ash/display/screen_position_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion ash/drag_drop/drag_image_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions ash/ime/candidate_window_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())));
Expand Down
4 changes: 2 additions & 2 deletions ash/ime/infolist_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions ash/ime/mode_indicator_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
12 changes: 6 additions & 6 deletions ash/popup_message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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
34 changes: 14 additions & 20 deletions ash/root_window_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -849,23 +846,22 @@ 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);

aura::Window* always_on_top_container = CreateContainer(
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);

Expand Down Expand Up @@ -902,16 +898,15 @@ 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);

aura::Window* input_method_container = CreateContainer(
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
Expand All @@ -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);

Expand All @@ -946,23 +941,22 @@ 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);

aura::Window* menu_container = CreateContainer(
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(
Expand Down
22 changes: 11 additions & 11 deletions ash/root_window_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ namespace gfx {
class Point;
}

namespace views {
class Widget;

namespace corewm {
class InputMethodEventFilter;
class RootWindowEventFilter;
class ScopedCaptureClient;
}
}

namespace keyboard {
class KeyboardController;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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);
};
Expand Down
12 changes: 6 additions & 6 deletions ash/shelf/shelf_tooltip_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion ash/shelf/shelf_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions ash/shelf/shelf_window_watcher_item_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Loading

0 comments on commit 067d7fe

Please sign in to comment.