summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-27 19:51:12 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-27 19:51:12 +0000
commitac1f2faf8571fbeb2cf0e2cc52de5ccdd858cb01 (patch)
treee6f97dcde442f34858e6b4283fa2f3d457404ce0
parentfca58f01b8ca6d8795ee617f211465e924ff33c7 (diff)
downloadchromium_src-ac1f2faf8571fbeb2cf0e2cc52de5ccdd858cb01.zip
chromium_src-ac1f2faf8571fbeb2cf0e2cc52de5ccdd858cb01.tar.gz
chromium_src-ac1f2faf8571fbeb2cf0e2cc52de5ccdd858cb01.tar.bz2
Move SetWindowBounds onto Widget.
BUG=72040 TEST=none Review URL: http://codereview.chromium.org/6976047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87073 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/native_dialog_window.cc2
-rw-r--r--chrome/browser/chromeos/options/network_config_view.cc2
-rw-r--r--chrome/browser/ui/views/hung_renderer_view.cc6
-rw-r--r--views/widget/native_widget.h2
-rw-r--r--views/widget/native_widget_gtk.cc6
-rw-r--r--views/widget/native_widget_gtk.h2
-rw-r--r--views/widget/native_widget_views.cc6
-rw-r--r--views/widget/native_widget_views.h2
-rw-r--r--views/widget/native_widget_win.cc61
-rw-r--r--views/widget/native_widget_win.h2
-rw-r--r--views/widget/widget.cc12
-rw-r--r--views/widget/widget.h10
-rw-r--r--views/window/native_window.h2
-rw-r--r--views/window/native_window_gtk.cc8
-rw-r--r--views/window/native_window_gtk.h2
-rw-r--r--views/window/native_window_views.cc7
-rw-r--r--views/window/native_window_views.h2
-rw-r--r--views/window/native_window_win.cc60
-rw-r--r--views/window/native_window_win.h2
-rw-r--r--views/window/window.cc7
-rw-r--r--views/window/window.h6
21 files changed, 112 insertions, 97 deletions
diff --git a/chrome/browser/chromeos/native_dialog_window.cc b/chrome/browser/chromeos/native_dialog_window.cc
index 7960580..9e4665d 100644
--- a/chrome/browser/chromeos/native_dialog_window.cc
+++ b/chrome/browser/chromeos/native_dialog_window.cc
@@ -147,7 +147,7 @@ void NativeDialogHost::OnCheckResize(GtkWidget* widget) {
gfx::Rect window_bounds = window()->GetBounds();
window_bounds.set_width(window_size.width());
window_bounds.set_height(window_size.height());
- window()->SetWindowBounds(window_bounds, NULL);
+ window()->SetBoundsConstrained(window_bounds, NULL);
}
}
}
diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc
index 4e625b6..97cedd4 100644
--- a/chrome/browser/chromeos/options/network_config_view.cc
+++ b/chrome/browser/chromeos/options/network_config_view.cc
@@ -141,7 +141,7 @@ void NetworkConfigView::ShowAdvancedView() {
int vert_padding = bounds.height() - size.height();
bounds.Inset(horiz_padding / 2, vert_padding / 2,
horiz_padding / 2, vert_padding / 2);
- window()->SetWindowBounds(bounds, GetNativeWindow());
+ window()->SetBoundsConstrained(bounds, NULL);
Layout();
child_config_view_->InitFocus();
}
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc
index c913ca2..031f95b 100644
--- a/chrome/browser/ui/views/hung_renderer_view.cc
+++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -246,7 +246,11 @@ void HungRendererDialogView::ShowForTabContents(TabContents* contents) {
volatile TabContents* this_contents = contents_;
gfx::Rect bounds = GetDisplayBounds(contents);
- window()->SetWindowBounds(bounds, frame_hwnd);
+ views::Widget* insert_after =
+ views::Widget::GetWidgetForNativeView(frame_hwnd);
+ window()->SetBoundsConstrained(bounds, insert_after);
+ if (insert_after)
+ window()->MoveAboveWidget(insert_after);
// We only do this if the window isn't active (i.e. hasn't been shown yet,
// or is currently shown but deactivated for another TabContents). This is
diff --git a/views/widget/native_widget.h b/views/widget/native_widget.h
index 0801971..b618fc5 100644
--- a/views/widget/native_widget.h
+++ b/views/widget/native_widget.h
@@ -136,6 +136,8 @@ class NativeWidget {
virtual gfx::Rect GetClientAreaScreenBounds() const = 0;
virtual void SetBounds(const gfx::Rect& bounds) = 0;
virtual void SetSize(const gfx::Size& size) = 0;
+ virtual void SetBoundsConstrained(const gfx::Rect& bounds,
+ Widget* other_widget) = 0;
virtual void MoveAbove(gfx::NativeView native_view) = 0;
virtual void SetShape(gfx::NativeRegion shape) = 0;
virtual void Close() = 0;
diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc
index ef3c7cd..d4295d5 100644
--- a/views/widget/native_widget_gtk.cc
+++ b/views/widget/native_widget_gtk.cc
@@ -912,6 +912,12 @@ void NativeWidgetGtk::SetSize(const gfx::Size& size) {
}
}
+void NativeWidgetGtk::SetBoundsConstrained(const gfx::Rect& bounds,
+ Widget* other_widget) {
+ // We apparently don't care about |other_widget|.
+ SetBounds(bounds);
+}
+
void NativeWidgetGtk::MoveAbove(gfx::NativeView native_view) {
ui::StackPopupWindow(GetNativeView(), native_view);
}
diff --git a/views/widget/native_widget_gtk.h b/views/widget/native_widget_gtk.h
index ffc0209..5ab27c9 100644
--- a/views/widget/native_widget_gtk.h
+++ b/views/widget/native_widget_gtk.h
@@ -172,6 +172,8 @@ class NativeWidgetGtk : public NativeWidget,
virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE;
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
virtual void SetSize(const gfx::Size& size) OVERRIDE;
+ virtual void SetBoundsConstrained(const gfx::Rect& bounds,
+ Widget* other_widget) OVERRIDE;
virtual void MoveAbove(gfx::NativeView native_view) OVERRIDE;
virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
virtual void Close() OVERRIDE;
diff --git a/views/widget/native_widget_views.cc b/views/widget/native_widget_views.cc
index e4dd08d..661a9c2 100644
--- a/views/widget/native_widget_views.cc
+++ b/views/widget/native_widget_views.cc
@@ -148,6 +148,12 @@ void NativeWidgetViews::SetSize(const gfx::Size& size) {
view_->SetSize(size);
}
+void NativeWidgetViews::SetBoundsConstrained(const gfx::Rect& bounds,
+ Widget* other_widget) {
+ // TODO(beng): honor other_widget.
+ SetBounds(bounds);
+}
+
void NativeWidgetViews::MoveAbove(gfx::NativeView native_view) {
NOTIMPLEMENTED();
}
diff --git a/views/widget/native_widget_views.h b/views/widget/native_widget_views.h
index be6fbc6..60361e3 100644
--- a/views/widget/native_widget_views.h
+++ b/views/widget/native_widget_views.h
@@ -60,6 +60,8 @@ class NativeWidgetViews : public NativeWidget {
virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE;
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
virtual void SetSize(const gfx::Size& size) OVERRIDE;
+ virtual void SetBoundsConstrained(const gfx::Rect& bounds,
+ Widget* other_widget) OVERRIDE;
virtual void MoveAbove(gfx::NativeView native_view) OVERRIDE;
virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
virtual void Close() OVERRIDE;
diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc
index 36a5d23..c6636ca 100644
--- a/views/widget/native_widget_win.cc
+++ b/views/widget/native_widget_win.cc
@@ -28,6 +28,7 @@
#include "views/focus/focus_util_win.h"
#include "views/focus/view_storage.h"
#include "views/ime/input_method_win.h"
+#include "views/screen.h"
#include "views/views_delegate.h"
#include "views/widget/aero_tooltip_manager.h"
#include "views/widget/child_window_message_processor.h"
@@ -117,6 +118,54 @@ bool DidClientAreaSizeChange(const WINDOWPOS* window_pos) {
window_pos->flags & SWP_FRAMECHANGED;
}
+// Ensures that the child window stays within the boundaries of the parent
+// before setting its bounds. If |parent_window| is NULL, the bounds of the
+// parent are assumed to be the bounds of the monitor that |child_window| is
+// nearest to. If |child_window| isn't visible yet and |insert_after_window|
+// is non-NULL and visible, the monitor |insert_after_window| is on is used
+// as the parent bounds instead.
+// TODO(beng): This function could easily not be so windowsy, deal with Widgets
+// instead of HWNDs, and move to Widget instead of NativeWidget and
+// then miraculously also work on Linux.
+void SetChildBounds(HWND child_window,
+ HWND parent_window,
+ HWND insert_after_window,
+ const gfx::Rect& bounds,
+ int padding,
+ unsigned long flags) {
+ DCHECK(IsWindow(child_window));
+
+ // First figure out the bounds of the parent.
+ RECT parent_rect = {0};
+ if (parent_window) {
+ GetClientRect(parent_window, &parent_rect);
+ } else {
+ // If there is no parent, we consider the bounds of the monitor the window
+ // is on to be the parent bounds.
+
+ // If the child_window isn't visible yet and we've been given a valid,
+ // visible insert after window, use that window to locate the correct
+ // monitor instead.
+ HWND window = child_window;
+ if (!IsWindowVisible(window) && IsWindow(insert_after_window) &&
+ IsWindowVisible(insert_after_window))
+ window = insert_after_window;
+
+ gfx::Rect work_area =
+ views::Screen::GetMonitorWorkAreaNearestPoint(bounds.origin());
+ if (!work_area.IsEmpty())
+ parent_rect = work_area.ToRECT();
+ }
+
+ gfx::Rect actual_bounds = bounds;
+ internal::EnsureRectIsVisibleInRect(gfx::Rect(parent_rect), &actual_bounds,
+ padding);
+
+ SetWindowPos(child_window, insert_after_window, actual_bounds.x(),
+ actual_bounds.y(), actual_bounds.width(),
+ actual_bounds.height(), flags);
+}
+
// Links the HWND to its NativeWidget.
const char* const kNativeWidgetKey = "__VIEWS_NATIVE_WIDGET__";
@@ -124,6 +173,11 @@ const char* const kNativeWidgetKey = "__VIEWS_NATIVE_WIDGET__";
// listening for MSAA events.
const int kCustomObjectID = 1;
+// If the hung renderer warning doesn't fit on screen, the amount of padding to
+// be left between the edge of the window and the edge of the nearest monitor,
+// after the window is nudged back on screen. Pixels.
+const int kMonitorEdgePadding = 10;
+
} // namespace
// static
@@ -333,6 +387,13 @@ void NativeWidgetWin::SetSize(const gfx::Size& size) {
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE);
}
+void NativeWidgetWin::SetBoundsConstrained(const gfx::Rect& bounds,
+ Widget* other_widget) {
+ SetChildBounds(GetNativeView(), GetParent(),
+ other_widget ? other_widget->GetNativeView() : NULL,
+ bounds, kMonitorEdgePadding, 0);
+}
+
void NativeWidgetWin::MoveAbove(gfx::NativeView native_view) {
SetWindowPos(native_view, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
diff --git a/views/widget/native_widget_win.h b/views/widget/native_widget_win.h
index f576d96..ad62cbd 100644
--- a/views/widget/native_widget_win.h
+++ b/views/widget/native_widget_win.h
@@ -191,6 +191,8 @@ class NativeWidgetWin : public ui::WindowImpl,
virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE;
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
virtual void SetSize(const gfx::Size& size) OVERRIDE;
+ virtual void SetBoundsConstrained(const gfx::Rect& bounds,
+ Widget* other_widget) OVERRIDE;
virtual void MoveAbove(gfx::NativeView native_view) OVERRIDE;
virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
virtual void Close() OVERRIDE;
diff --git a/views/widget/widget.cc b/views/widget/widget.cc
index 4f15d68..4ee727f 100644
--- a/views/widget/widget.cc
+++ b/views/widget/widget.cc
@@ -93,6 +93,13 @@ bool Widget::IsPureViews() {
return use_pure_views;
}
+// static
+Widget* Widget::GetWidgetForNativeView(gfx::NativeView native_view) {
+ NativeWidget* native_widget =
+ NativeWidget::GetNativeWidgetForNativeView(native_view);
+ return native_widget ? native_widget->GetWidget() : NULL;
+}
+
void Widget::Init(const InitParams& params) {
ownership_ = params.ownership;
native_widget_ =
@@ -185,6 +192,11 @@ void Widget::SetSize(const gfx::Size& size) {
native_widget_->SetSize(size);
}
+void Widget::SetBoundsConstrained(const gfx::Rect& bounds,
+ Widget* other_widget) {
+ native_widget_->SetBoundsConstrained(bounds, other_widget);
+}
+
void Widget::MoveAboveWidget(Widget* widget) {
native_widget_->MoveAbove(widget->GetNativeView());
}
diff --git a/views/widget/widget.h b/views/widget/widget.h
index aad6331..cd077c3 100644
--- a/views/widget/widget.h
+++ b/views/widget/widget.h
@@ -150,6 +150,9 @@ class Widget : public internal::NativeWidgetDelegate,
static void SetPureViews(bool pure);
static bool IsPureViews();
+ // Passes through to NativeWidget::GetWidgetForNativeView().
+ static Widget* GetWidgetForNativeView(gfx::NativeView native_view);
+
void Init(const InitParams& params);
// Unconverted methods -------------------------------------------------------
@@ -213,6 +216,13 @@ class Widget : public internal::NativeWidgetDelegate,
void SetBounds(const gfx::Rect& bounds);
void SetSize(const gfx::Size& size);
+ // Like SetBounds(), but ensures the Widget is fully visible within the bounds
+ // of its parent. If the Widget has no parent, it is centered within the
+ // bounds of its screen if it is visible, or |other_widget|'s screen if it is
+ // not.
+ void SetBoundsConstrained(const gfx::Rect& bounds,
+ Widget* other_widget);
+
// Places the widget in front of the specified widget in z-order.
void MoveAboveWidget(Widget* widget);
void MoveAbove(gfx::NativeView native_view);
diff --git a/views/window/native_window.h b/views/window/native_window.h
index 0ede59b..e029718 100644
--- a/views/window/native_window.h
+++ b/views/window/native_window.h
@@ -89,8 +89,6 @@ class NativeWindow {
// Window pass-thrus ---------------------------------------------------------
// See documentation in window.h
- virtual void SetWindowBounds(const gfx::Rect& bounds,
- gfx::NativeWindow other_window) = 0;
virtual void SetFullscreen(bool fullscreen) = 0;
virtual bool IsFullscreen() const = 0;
virtual void SetUseDragFrame(bool use_drag_frame) = 0;
diff --git a/views/window/native_window_gtk.cc b/views/window/native_window_gtk.cc
index d65d9c0..a2bf870 100644
--- a/views/window/native_window_gtk.cc
+++ b/views/window/native_window_gtk.cc
@@ -247,7 +247,7 @@ void NativeWindowGtk::CenterWindow(const gfx::Size& size) {
gfx::Rect bounds(center_rect.x() + (center_rect.width() - size.width()) / 2,
center_rect.y() + (center_rect.height() - size.height()) / 2,
size.width(), size.height());
- SetWindowBounds(bounds, NULL);
+ SetBoundsConstrained(bounds, NULL);
}
void NativeWindowGtk::GetWindowBoundsAndMaximizedState(gfx::Rect* bounds,
@@ -285,12 +285,6 @@ const Window* NativeWindowGtk::GetWindow() const {
return delegate_->AsWindow();
}
-void NativeWindowGtk::SetWindowBounds(const gfx::Rect& bounds,
- gfx::NativeWindow other_window) {
- // TODO: need to deal with other_window.
- NativeWidgetGtk::SetBounds(bounds);
-}
-
void NativeWindowGtk::SetFullscreen(bool fullscreen) {
if (fullscreen)
gtk_window_fullscreen(GetNativeWindow());
diff --git a/views/window/native_window_gtk.h b/views/window/native_window_gtk.h
index 56e46da..1d7a773 100644
--- a/views/window/native_window_gtk.h
+++ b/views/window/native_window_gtk.h
@@ -61,8 +61,6 @@ class NativeWindowGtk : public NativeWidgetGtk, public NativeWindow {
virtual void SetAccessibleName(const std::wstring& name) OVERRIDE;
virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE;
virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE;
- virtual void SetWindowBounds(const gfx::Rect& bounds,
- gfx::NativeWindow other_window) OVERRIDE;
virtual void SetFullscreen(bool fullscreen) OVERRIDE;
virtual bool IsFullscreen() const OVERRIDE;
virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE;
diff --git a/views/window/native_window_views.cc b/views/window/native_window_views.cc
index de2e2ed..21addf3 100644
--- a/views/window/native_window_views.cc
+++ b/views/window/native_window_views.cc
@@ -85,13 +85,6 @@ void NativeWindowViews::SetAccessibleState(
ui::AccessibilityTypes::State state) {
}
-void NativeWindowViews::SetWindowBounds(const gfx::Rect& bounds,
- gfx::NativeWindow other_window) {
- if (other_window)
- NOTIMPLEMENTED();
- GetView()->SetBoundsRect(bounds);
-}
-
void NativeWindowViews::SetFullscreen(bool fullscreen) {
}
diff --git a/views/window/native_window_views.h b/views/window/native_window_views.h
index 83339be..1d1ac2d 100644
--- a/views/window/native_window_views.h
+++ b/views/window/native_window_views.h
@@ -42,8 +42,6 @@ class NativeWindowViews : public NativeWidgetViews,
virtual void SetAccessibleName(const std::wstring& name) OVERRIDE;
virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE;
virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE;
- virtual void SetWindowBounds(const gfx::Rect& bounds,
- gfx::NativeWindow other_window) OVERRIDE;
virtual void SetFullscreen(bool fullscreen) OVERRIDE;
virtual bool IsFullscreen() const OVERRIDE;
virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE;
diff --git a/views/window/native_window_win.cc b/views/window/native_window_win.cc
index c72822a..0b3e0d1d 100644
--- a/views/window/native_window_win.cc
+++ b/views/window/native_window_win.cc
@@ -53,55 +53,6 @@ bool GetMonitorAndRects(const RECT& rect,
return true;
}
-// Ensures that the child window stays within the boundaries of the parent
-// before setting its bounds. If |parent_window| is NULL, the bounds of the
-// parent are assumed to be the bounds of the monitor that |child_window| is
-// nearest to. If |child_window| isn't visible yet and |insert_after_window|
-// is non-NULL and visible, the monitor |insert_after_window| is on is used
-// as the parent bounds instead.
-void SetChildBounds(HWND child_window, HWND parent_window,
- HWND insert_after_window, const gfx::Rect& bounds,
- int padding, unsigned long flags) {
- DCHECK(IsWindow(child_window));
-
- // First figure out the bounds of the parent.
- RECT parent_rect = {0};
- if (parent_window) {
- GetClientRect(parent_window, &parent_rect);
- } else {
- // If there is no parent, we consider the bounds of the monitor the window
- // is on to be the parent bounds.
-
- // If the child_window isn't visible yet and we've been given a valid,
- // visible insert after window, use that window to locate the correct
- // monitor instead.
- HWND window = child_window;
- if (!IsWindowVisible(window) && IsWindow(insert_after_window) &&
- IsWindowVisible(insert_after_window))
- window = insert_after_window;
-
- POINT window_point = { bounds.x(), bounds.y() };
- HMONITOR monitor = MonitorFromPoint(window_point,
- MONITOR_DEFAULTTONEAREST);
- if (monitor) {
- MONITORINFO mi = {0};
- mi.cbSize = sizeof(mi);
- GetMonitorInfo(monitor, &mi);
- parent_rect = mi.rcWork;
- } else {
- NOTREACHED() << "Unable to get default monitor";
- }
- }
-
- gfx::Rect actual_bounds = bounds;
- internal::EnsureRectIsVisibleInRect(gfx::Rect(parent_rect), &actual_bounds,
- padding);
-
- SetWindowPos(child_window, insert_after_window, actual_bounds.x(),
- actual_bounds.y(), actual_bounds.width(),
- actual_bounds.height(), flags);
-}
-
// Returns true if edge |edge| (one of ABE_LEFT, TOP, RIGHT, or BOTTOM) of
// monitor |monitor| has an auto-hiding taskbar that's always-on-top.
bool EdgeHasTopmostAutoHideTaskbar(UINT edge, HMONITOR monitor) {
@@ -140,11 +91,6 @@ void EnableMenuItem(HMENU menu, UINT command, bool enabled) {
EnableMenuItem(menu, command, flags);
}
-// If the hung renderer warning doesn't fit on screen, the amount of padding to
-// be left between the edge of the window and the edge of the nearest monitor,
-// after the window is nudged back on screen. Pixels.
-const int kMonitorEdgePadding = 10;
-
} // namespace
namespace internal {
@@ -1169,12 +1115,6 @@ void NativeWindowWin::SetAccessibleState(ui::AccessibilityTypes::State state) {
}
}
-void NativeWindowWin::SetWindowBounds(const gfx::Rect& bounds,
- gfx::NativeWindow other_window) {
- SetChildBounds(GetNativeView(), GetParent(), other_window, bounds,
- kMonitorEdgePadding, 0);
-}
-
void NativeWindowWin::SetFullscreen(bool fullscreen) {
if (fullscreen_ == fullscreen)
return; // Nothing to do.
diff --git a/views/window/native_window_win.h b/views/window/native_window_win.h
index 71eac11..a79025b 100644
--- a/views/window/native_window_win.h
+++ b/views/window/native_window_win.h
@@ -149,8 +149,6 @@ class NativeWindowWin : public NativeWidgetWin,
virtual void SetAccessibleName(const std::wstring& name) OVERRIDE;
virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE;
virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE;
- virtual void SetWindowBounds(const gfx::Rect& bounds,
- gfx::NativeWindow other_window) OVERRIDE;
virtual void SetFullscreen(bool fullscreen) OVERRIDE;
virtual bool IsFullscreen() const OVERRIDE;
virtual void SetUseDragFrame(bool use_drag_frame) OVERRIDE;
diff --git a/views/window/window.cc b/views/window/window.cc
index 1886aa5..ca9519f 100644
--- a/views/window/window.cc
+++ b/views/window/window.cc
@@ -107,11 +107,6 @@ gfx::Rect Window::GetNormalBounds() const {
return native_window_->GetRestoredBounds();
}
-void Window::SetWindowBounds(const gfx::Rect& bounds,
- gfx::NativeWindow other_window) {
- native_window_->SetWindowBounds(bounds, other_window);
-}
-
void Window::ShowInactive() {
native_window_->ShowNativeWindow(NativeWindow::SHOW_INACTIVE);
}
@@ -352,7 +347,7 @@ void Window::SetInitialBounds(const gfx::Rect& bounds) {
native_window_->CenterWindow(non_client_view_->GetPreferredSize());
} else {
// Use the supplied initial bounds.
- SetWindowBounds(bounds, NULL);
+ SetBoundsConstrained(bounds, NULL);
}
}
}
diff --git a/views/window/window.h b/views/window/window.h
index 669b23d..ddd8789 100644
--- a/views/window/window.h
+++ b/views/window/window.h
@@ -79,12 +79,6 @@ class Window : public Widget,
// Retrieves the restored bounds for the window.
gfx::Rect GetNormalBounds() const;
- // Sets the Window's bounds. The window is inserted after |other_window| in
- // the window Z-order. If this window is not yet visible, other_window's
- // monitor is used as the constraining rectangle, rather than this window's
- // monitor.
- void SetWindowBounds(const gfx::Rect& bounds, gfx::NativeWindow other_window);
-
// Like Show(), but does not activate the window.
void ShowInactive();