Commit a6f7d3be authored by xiyuan@chromium.org's avatar xiyuan@chromium.org

[ChromeOS] Ensure advanced network config dialog is centered.

Explicitly set new bounds of advanced network config dialog instead of
relying on window manager to center it.

BUG=chromium-os:15430
TEST=Verify fix for chromium-os:15430.

Review URL: http://codereview.chromium.org/7066002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86428 0039d316-1c4b-4281-b951-d872f2087c98
parent ae5dda72
......@@ -135,8 +135,12 @@ void NetworkConfigView::ShowAdvancedView() {
gfx::Size size = views::Window::GetLocalizedContentsSize(
IDS_JOIN_WIFI_NETWORK_DIALOG_WIDTH_CHARS,
IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_MINIMUM_HEIGHT_LINES);
gfx::Rect bounds(size.width(), size.height());
// Window is automatically centered.
// Get the new bounds with desired size at the same center point.
gfx::Rect bounds = window()->GetBounds();
int horiz_padding = bounds.width() - size.width();
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());
Layout();
child_config_view_->InitFocus();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment