| OLD | NEW |
| 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/wifi_config_view.h" | 5 #include "chrome/browser/chromeos/options/wifi_config_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/chromeos/enrollment_dialog_view.h" | 13 #include "chrome/browser/chromeos/enrollment_dialog_view.h" |
| 14 #include "chrome/browser/chromeos/net/shill_error.h" | 14 #include "chrome/browser/chromeos/net/shill_error.h" |
| 15 #include "chrome/browser/chromeos/options/passphrase_textfield.h" | 15 #include "chrome/browser/chromeos/options/passphrase_textfield.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/ui/views/harmony/layout_delegate.h" | 17 #include "chrome/browser/ui/views/harmony/layout_delegate.h" |
| 18 #include "chrome/browser/ui/views/layout_utils.h" |
| 18 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
| 19 #include "chrome/grit/theme_resources.h" | 20 #include "chrome/grit/theme_resources.h" |
| 20 #include "chromeos/login/login_state.h" | 21 #include "chromeos/login/login_state.h" |
| 21 #include "chromeos/network/client_cert_util.h" | 22 #include "chromeos/network/client_cert_util.h" |
| 22 #include "chromeos/network/network_configuration_handler.h" | 23 #include "chromeos/network/network_configuration_handler.h" |
| 23 #include "chromeos/network/network_connect.h" | 24 #include "chromeos/network/network_connect.h" |
| 24 #include "chromeos/network/network_event_log.h" | 25 #include "chromeos/network/network_event_log.h" |
| 25 #include "chromeos/network/network_handler.h" | 26 #include "chromeos/network/network_handler.h" |
| 26 #include "chromeos/network/network_state.h" | 27 #include "chromeos/network/network_state.h" |
| 27 #include "chromeos/network/network_state_handler.h" | 28 #include "chromeos/network/network_state_handler.h" |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 ParseEAPUIProperty( | 928 ParseEAPUIProperty( |
| 928 &identity_anonymous_ui_data_, network, ::onc::eap::kAnonymousIdentity); | 929 &identity_anonymous_ui_data_, network, ::onc::eap::kAnonymousIdentity); |
| 929 ParseEAPUIProperty( | 930 ParseEAPUIProperty( |
| 930 &save_credentials_ui_data_, network, ::onc::eap::kSaveCredentials); | 931 &save_credentials_ui_data_, network, ::onc::eap::kSaveCredentials); |
| 931 if (show_8021x) | 932 if (show_8021x) |
| 932 ParseEAPUIProperty(&passphrase_ui_data_, network, ::onc::eap::kPassword); | 933 ParseEAPUIProperty(&passphrase_ui_data_, network, ::onc::eap::kPassword); |
| 933 else | 934 else |
| 934 ParseUIProperty(&passphrase_ui_data_, network, ::onc::wifi::kPassphrase); | 935 ParseUIProperty(&passphrase_ui_data_, network, ::onc::wifi::kPassphrase); |
| 935 } | 936 } |
| 936 | 937 |
| 937 views::GridLayout* layout = new views::GridLayout(this); | 938 views::GridLayout* layout = layout_utils::CreatePanelLayout(this); |
| 938 LayoutDelegate* delegate = LayoutDelegate::Get(); | 939 LayoutDelegate* delegate = LayoutDelegate::Get(); |
| 939 layout->SetInsets(gfx::Insets( | |
| 940 delegate->GetLayoutDistance( | |
| 941 LayoutDelegate::LayoutDistanceType::PANEL_HORIZ_MARGIN), | |
| 942 delegate->GetLayoutDistance( | |
| 943 LayoutDelegate::LayoutDistanceType::PANEL_VERT_MARGIN), | |
| 944 delegate->GetLayoutDistance( | |
| 945 LayoutDelegate::LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW), | |
| 946 delegate->GetLayoutDistance( | |
| 947 LayoutDelegate::LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW))); | |
| 948 this->SetLayoutManager(layout); | |
| 949 | 940 |
| 950 const int column_view_set_id = 0; | 941 const int column_view_set_id = 0; |
| 951 views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); | 942 views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); |
| 952 const int kLabelMinWidth = 150; | 943 const int kLabelMinWidth = 150; |
| 953 const int kPasswordVisibleWidth = 20; | 944 const int kPasswordVisibleWidth = 20; |
| 954 // Label | 945 // Label |
| 955 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, | 946 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, |
| 956 views::GridLayout::USE_PREF, 0, kLabelMinWidth); | 947 views::GridLayout::USE_PREF, 0, kLabelMinWidth); |
| 957 column_set->AddPaddingColumn( | 948 column_set->AddPaddingColumn( |
| 958 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: | 949 0, delegate->GetLayoutDistance(LayoutDelegate::LayoutDistanceType:: |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 void WifiConfigView::ParseEAPUIProperty(NetworkPropertyUIData* property_ui_data, | 1441 void WifiConfigView::ParseEAPUIProperty(NetworkPropertyUIData* property_ui_data, |
| 1451 const NetworkState* network, | 1442 const NetworkState* network, |
| 1452 const std::string& key) { | 1443 const std::string& key) { |
| 1453 std::string onc_tag = network->type() == shill::kTypeEthernet | 1444 std::string onc_tag = network->type() == shill::kTypeEthernet |
| 1454 ? ::onc::ethernet::kEAP | 1445 ? ::onc::ethernet::kEAP |
| 1455 : ::onc::wifi::kEAP; | 1446 : ::onc::wifi::kEAP; |
| 1456 ParseUIProperty(property_ui_data, network, onc_tag + '.' + key); | 1447 ParseUIProperty(property_ui_data, network, onc_tag + '.' + key); |
| 1457 } | 1448 } |
| 1458 | 1449 |
| 1459 } // namespace chromeos | 1450 } // namespace chromeos |
| OLD | NEW |