Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Unified Diff: chrome/browser/chromeos/options/network_config_view.cc

Issue 7066002: [ChromeOS] Ensure advanced network config dialog is centered. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test upload after moving change to a different branch. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/options/network_config_view.cc
diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc
index 19c1218aea5a4390471c1d0f4573769739e1c571..b4a75ceb43897c59139de75f784fdd70dd88b69f 100644
--- a/chrome/browser/chromeos/options/network_config_view.cc
+++ b/chrome/browser/chromeos/options/network_config_view.cc
@@ -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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698