| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/options/network_config_view.h" | 5 #include "chrome/browser/chromeos/options/network_config_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Resize the window to be able to hold the new widgets. | 132 // Resize the window to be able to hold the new widgets. |
| 133 gfx::Size size = views::Widget::GetLocalizedContentsSize( | 133 gfx::Size size = views::Widget::GetLocalizedContentsSize( |
| 134 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_WIDTH_CHARS, | 134 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_WIDTH_CHARS, |
| 135 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_MINIMUM_HEIGHT_LINES); | 135 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_MINIMUM_HEIGHT_LINES); |
| 136 // Get the new bounds with desired size at the same center point. | 136 // Get the new bounds with desired size at the same center point. |
| 137 gfx::Rect bounds = GetWidget()->GetWindowScreenBounds(); | 137 gfx::Rect bounds = GetWidget()->GetWindowScreenBounds(); |
| 138 int horiz_padding = bounds.width() - size.width(); | 138 int horiz_padding = bounds.width() - size.width(); |
| 139 int vert_padding = bounds.height() - size.height(); | 139 int vert_padding = bounds.height() - size.height(); |
| 140 bounds.Inset(horiz_padding / 2, vert_padding / 2, | 140 bounds.Inset(horiz_padding / 2, vert_padding / 2, |
| 141 horiz_padding / 2, vert_padding / 2); | 141 horiz_padding / 2, vert_padding / 2); |
| 142 GetWidget()->SetBoundsConstrained(bounds, NULL); | 142 GetWidget()->SetBoundsConstrained(bounds); |
| 143 Layout(); | 143 Layout(); |
| 144 child_config_view_->InitFocus(); | 144 child_config_view_->InitFocus(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void NetworkConfigView::Layout() { | 147 void NetworkConfigView::Layout() { |
| 148 child_config_view_->SetBounds(0, 0, width(), height()); | 148 child_config_view_->SetBounds(0, 0, width(), height()); |
| 149 } | 149 } |
| 150 | 150 |
| 151 gfx::Size NetworkConfigView::GetPreferredSize() { | 151 gfx::Size NetworkConfigView::GetPreferredSize() { |
| 152 gfx::Size result(views::Widget::GetLocalizedContentsSize( | 152 gfx::Size result(views::Widget::GetLocalizedContentsSize( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 181 | 181 |
| 182 int column_set_id = 0; | 182 int column_set_id = 0; |
| 183 views::ColumnSet* column_set = layout->AddColumnSet(column_set_id); | 183 views::ColumnSet* column_set = layout->AddColumnSet(column_set_id); |
| 184 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, | 184 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, |
| 185 0, views::GridLayout::USE_PREF, 0, 0); | 185 0, views::GridLayout::USE_PREF, 0, 0); |
| 186 layout->StartRow(0, column_set_id); | 186 layout->StartRow(0, column_set_id); |
| 187 layout->AddView(advanced_button_); | 187 layout->AddView(advanced_button_); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace chromeos | 190 } // namespace chromeos |
| OLD | NEW |