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

Side by Side Diff: chrome/browser/chromeos/options/network_config_view.cc

Issue 2871253002: Chrome OS: Fix the chopped Wi-Fi Network Configuration Dialog (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void NetworkConfigView::ShowAdvancedView() { 227 void NetworkConfigView::ShowAdvancedView() {
228 // Clear out the old widgets and build new ones. 228 // Clear out the old widgets and build new ones.
229 RemoveChildView(child_config_view_); 229 RemoveChildView(child_config_view_);
230 delete child_config_view_; 230 delete child_config_view_;
231 // For now, there is only an advanced view for Wi-Fi 802.1X. 231 // For now, there is only an advanced view for Wi-Fi 802.1X.
232 child_config_view_ = new WifiConfigView(this, 232 child_config_view_ = new WifiConfigView(this,
233 "" /* service_path */, 233 "" /* service_path */,
234 true /* show_8021x */); 234 true /* show_8021x */);
235 AddChildView(child_config_view_); 235 AddChildView(child_config_view_);
236 // Resize the window to be able to hold the new widgets. 236 // Resize the window to be able to hold the new widgets.
237 gfx::Size size = GetWidget()->client_view()->GetPreferredSize(); 237 gfx::Size size = GetWidget()->non_client_view()->GetPreferredSize();
238 gfx::Size predefined_size = views::Widget::GetLocalizedContentsSize( 238 gfx::Size predefined_size = views::Widget::GetLocalizedContentsSize(
239 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_WIDTH_CHARS, 239 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_WIDTH_CHARS,
240 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_MINIMUM_HEIGHT_LINES); 240 IDS_JOIN_WIFI_NETWORK_DIALOG_ADVANCED_MINIMUM_HEIGHT_LINES);
241 // Use the pre-determined value to determine its size for non-harmony dialog. 241 // Use the pre-determined value to determine its size for non-harmony dialog.
242 if (!ui::MaterialDesignController::IsSecondaryUiMaterial()) 242 if (!ui::MaterialDesignController::IsSecondaryUiMaterial())
243 size.SetToMax(predefined_size); 243 size.SetToMax(predefined_size);
244 244
245 // Get the new bounds with desired size at the same center point. 245 // Get the new bounds with desired size at the same center point.
246 gfx::Rect bounds = GetWidget()->GetWindowBoundsInScreen(); 246 gfx::Rect bounds = GetWidget()->GetWindowBoundsInScreen();
247 int horiz_padding = bounds.width() - size.width(); 247 int horiz_padding = bounds.width() - size.width();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 336 }
337 337
338 ControlledSettingIndicatorView::~ControlledSettingIndicatorView() {} 338 ControlledSettingIndicatorView::~ControlledSettingIndicatorView() {}
339 339
340 gfx::Size ControlledSettingIndicatorView::GetPreferredSize() const { 340 gfx::Size ControlledSettingIndicatorView::GetPreferredSize() const {
341 return (managed_ && visible()) ? image_view_->GetPreferredSize() 341 return (managed_ && visible()) ? image_view_->GetPreferredSize()
342 : gfx::Size(); 342 : gfx::Size();
343 } 343 }
344 344
345 } // namespace chromeos 345 } // namespace chromeos
OLDNEW
« 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