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

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

Issue 2869019: Don't generate a certificate browse button or passphrase field if cert path contains SETTINGS: (Closed)
Patch Set: Simplified SETTINGS: parsing. Created 10 years, 6 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
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 d854954e6886c29a84b85452091a8a4509291915..d7798622c6b9f785b98948555b18374527c8a9e2 100644
--- a/chrome/browser/chromeos/options/network_config_view.cc
+++ b/chrome/browser/chromeos/options/network_config_view.cc
@@ -115,7 +115,8 @@ void NetworkConfigView::TabSelectedAt(int index) {
}
void NetworkConfigView::SetLoginTextfieldFocus() {
- wificonfig_view_->FocusFirstField();
+ if (wificonfig_view_)
+ wificonfig_view_->FocusFirstField();
}
void NetworkConfigView::Layout() {
@@ -125,9 +126,26 @@ void NetworkConfigView::Layout() {
gfx::Size NetworkConfigView::GetPreferredSize() {
// TODO(chocobo): Once UI is finalized, create locale settings.
- return gfx::Size(views::Window::GetLocalizedContentsSize(
+ gfx::Size result(views::Window::GetLocalizedContentsSize(
IDS_IMPORT_DIALOG_WIDTH_CHARS,
IDS_IMPORT_DIALOG_HEIGHT_LINES));
+ result.set_height(0); // IMPORT_DIALOG height is too large
+ // Expand the default size to fit results if necessary
+ if (wificonfig_view_) {
+ gfx::Size s = wificonfig_view_->GetPreferredSize();
+ s.set_height(s.height() + kPanelVertMargin * 2);
+ s.set_width(s.width() + kPanelHorizMargin * 2);
+ result = gfx::Size(std::max(result.width(), s.width()),
+ std::max(result.height(), s.height()));
+ }
+ if (ipconfig_view_) {
+ gfx::Size s = ipconfig_view_->GetPreferredSize();
+ s.set_height(s.height() + kPanelVertMargin * 2);
+ s.set_width(s.width() + kPanelHorizMargin * 2);
+ result = gfx::Size(std::max(result.width(), s.width()),
+ std::max(result.height(), s.height()));
+ }
+ return result;
}
void NetworkConfigView::ViewHierarchyChanged(

Powered by Google App Engine
This is Rietveld 408576698