| Index: ash/wm/window_util.cc
|
| diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
|
| index f888f79fb60e516b22e8cd85b04882707ac589c0..c8e5f76041080b2b66559f51f1a8fb3139463875 100644
|
| --- a/ash/wm/window_util.cc
|
| +++ b/ash/wm/window_util.cc
|
| @@ -34,25 +34,6 @@
|
| namespace ash {
|
| namespace wm {
|
|
|
| -namespace {
|
| -
|
| -// Returns the default width of a snapped window.
|
| -int GetDefaultSnappedWindowWidth(wm::WmWindow* window) {
|
| - const float kSnappedWidthWorkspaceRatio = 0.5f;
|
| -
|
| - int work_area_width = GetDisplayWorkAreaBoundsInParent(window).width();
|
| - int min_width = window->GetMinimumSize().width();
|
| - int ideal_width =
|
| - static_cast<int>(work_area_width * kSnappedWidthWorkspaceRatio);
|
| - return std::min(work_area_width, std::max(ideal_width, min_width));
|
| -}
|
| -
|
| -int GetDefaultSnappedWindowWidth(aura::Window* window) {
|
| - return GetDefaultSnappedWindowWidth(WmWindowAura::Get(window));
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| // TODO(beng): replace many of these functions with the corewm versions.
|
| void ActivateWindow(aura::Window* window) {
|
| ::wm::ActivateWindow(window);
|
| @@ -92,39 +73,6 @@ void CenterWindow(aura::Window* window) {
|
| wm::GetWindowState(window)->OnWMEvent(&event);
|
| }
|
|
|
| -gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(wm::WmWindow* window) {
|
| - gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window));
|
| - return gfx::Rect(work_area_in_parent.x(), work_area_in_parent.y(),
|
| - GetDefaultSnappedWindowWidth(window),
|
| - work_area_in_parent.height());
|
| -}
|
| -
|
| -gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(wm::WmWindow* window) {
|
| - gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window));
|
| - int width = GetDefaultSnappedWindowWidth(window);
|
| - return gfx::Rect(work_area_in_parent.right() - width, work_area_in_parent.y(),
|
| - width, work_area_in_parent.height());
|
| -}
|
| -
|
| -gfx::Rect GetDefaultLeftSnappedWindowBoundsInParent(aura::Window* window) {
|
| - gfx::Rect work_area_in_parent(ScreenUtil::GetDisplayWorkAreaBoundsInParent(
|
| - window));
|
| - return gfx::Rect(work_area_in_parent.x(),
|
| - work_area_in_parent.y(),
|
| - GetDefaultSnappedWindowWidth(window),
|
| - work_area_in_parent.height());
|
| -}
|
| -
|
| -gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(aura::Window* window) {
|
| - gfx::Rect work_area_in_parent(ScreenUtil::GetDisplayWorkAreaBoundsInParent(
|
| - window));
|
| - int width = GetDefaultSnappedWindowWidth(window);
|
| - return gfx::Rect(work_area_in_parent.right() - width,
|
| - work_area_in_parent.y(),
|
| - width,
|
| - work_area_in_parent.height());
|
| -}
|
| -
|
| bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) {
|
| views::View* target = static_cast<views::View*>(event.target());
|
| if (!target)
|
| @@ -140,27 +88,6 @@ bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) {
|
| return true;
|
| }
|
|
|
| -void ReparentChildWithTransientChildren(aura::Window* child,
|
| - aura::Window* old_parent,
|
| - aura::Window* new_parent) {
|
| - if (child->parent() == old_parent)
|
| - new_parent->AddChild(child);
|
| - ReparentTransientChildrenOfChild(child, old_parent, new_parent);
|
| -}
|
| -
|
| -void ReparentTransientChildrenOfChild(aura::Window* child,
|
| - aura::Window* old_parent,
|
| - aura::Window* new_parent) {
|
| - for (size_t i = 0;
|
| - i < ::wm::GetTransientChildren(child).size();
|
| - ++i) {
|
| - ReparentChildWithTransientChildren(
|
| - ::wm::GetTransientChildren(child)[i],
|
| - old_parent,
|
| - new_parent);
|
| - }
|
| -}
|
| -
|
| void SnapWindowToPixelBoundary(aura::Window* window) {
|
| aura::Window* snapped_ancestor = window->parent();
|
| while (snapped_ancestor) {
|
|
|