diff options
author | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 13:36:09 +0000 |
---|---|---|
committer | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 13:36:09 +0000 |
commit | 1fcdf80e07e3118326b8ab169bbb66a0e36ba1cd (patch) | |
tree | 8ef37c4e3567db3a20c754b8b9ebfb2fbc2d10ec /chrome/browser/chromeos | |
parent | 6b055b9489eefc146b7143e4068fa36ed4b252d5 (diff) | |
download | chromium_src-1fcdf80e07e3118326b8ab169bbb66a0e36ba1cd.zip chromium_src-1fcdf80e07e3118326b8ab169bbb66a0e36ba1cd.tar.gz chromium_src-1fcdf80e07e3118326b8ab169bbb66a0e36ba1cd.tar.bz2 |
Cleanup NetworkPropertyUIData.
This removes the dependency on NetworkUIData.
BUG=NONE
Review URL: https://chromiumcodereview.appspot.com/15297002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
8 files changed, 98 insertions, 137 deletions
diff --git a/chrome/browser/chromeos/cros/network_property_ui_data.cc b/chrome/browser/chromeos/cros/network_property_ui_data.cc index 6c98f80..fc94a96 100644 --- a/chrome/browser/chromeos/cros/network_property_ui_data.cc +++ b/chrome/browser/chromeos/cros/network_property_ui_data.cc @@ -5,37 +5,27 @@ #include "chrome/browser/chromeos/cros/network_property_ui_data.h" #include "base/values.h" -#include "chromeos/network/network_ui_data.h" namespace chromeos { -// Property names for the per-property dictionary. -const char NetworkPropertyUIData::kKeyController[] = "controller"; -const char NetworkPropertyUIData::kKeyDefaultValue[] = "default_value"; - NetworkPropertyUIData::NetworkPropertyUIData() - : controller_(CONTROLLER_USER) { + : onc_source_(onc::ONC_SOURCE_NONE) { } -NetworkPropertyUIData::~NetworkPropertyUIData() { +NetworkPropertyUIData::NetworkPropertyUIData(onc::ONCSource onc_source) + : onc_source_(onc_source) { } -NetworkPropertyUIData::NetworkPropertyUIData( - const NetworkUIData& ui_data) { - Reset(ui_data); +NetworkPropertyUIData::~NetworkPropertyUIData() { } -void NetworkPropertyUIData::Reset(const NetworkUIData& ui_data) { +void NetworkPropertyUIData::ParseOncProperty(onc::ONCSource onc_source, + const base::DictionaryValue* onc, + const std::string& property_key) { default_value_.reset(); - controller_ = ui_data.is_managed() ? CONTROLLER_POLICY : CONTROLLER_USER; -} + onc_source_ = onc_source; -void NetworkPropertyUIData::ParseOncProperty( - const NetworkUIData& ui_data, - const base::DictionaryValue* onc, - const std::string& property_key) { - Reset(ui_data); - if (!onc || controller_ == CONTROLLER_USER) + if (!onc || !IsManaged()) return; size_t pos = property_key.find_last_of('.'); @@ -51,7 +41,7 @@ void NetworkPropertyUIData::ParseOncProperty( if (onc->GetList(recommended_property_key, &recommended_keys)) { base::StringValue basename_value(property_basename); if (recommended_keys->Find(basename_value) != recommended_keys->end()) { - controller_ = CONTROLLER_USER; + onc_source_ = onc::ONC_SOURCE_NONE; const base::Value* default_value = NULL; if (onc->Get(property_key, &default_value)) default_value_.reset(default_value->DeepCopy()); diff --git a/chrome/browser/chromeos/cros/network_property_ui_data.h b/chrome/browser/chromeos/cros/network_property_ui_data.h index d905a40..0a73ed4 100644 --- a/chrome/browser/chromeos/cros/network_property_ui_data.h +++ b/chrome/browser/chromeos/cros/network_property_ui_data.h @@ -9,6 +9,7 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" +#include "chromeos/network/onc/onc_constants.h" namespace base { class DictionaryValue; @@ -17,55 +18,36 @@ class Value; namespace chromeos { -class NetworkUIData; - // Holds meta information for a network property: Whether the property is under -// policy control, if it is user-editable, and whether the policy-provided -// default value, if applicable. +// policy control, if it is user-editable, and policy-provided default value, if +// available. class NetworkPropertyUIData { public: - // Enum values indicating the entity controlling the property. - enum Controller { - // Property is managed by policy. - CONTROLLER_POLICY, - // The user controls the policy. - CONTROLLER_USER, - }; - - // Initializes the object with CONTROLLER_USER and no default value. + // Initializes with ONC_SOURCE_NONE and no default value. NetworkPropertyUIData(); - ~NetworkPropertyUIData(); - // Initializes the object by calling Reset() with the provided ui_data. - explicit NetworkPropertyUIData(const NetworkUIData& ui_data); + // Initializes with the given |onc_source| and no default value. + explicit NetworkPropertyUIData(onc::ONCSource onc_source); - // Resets the property to the controller specified by the given |ui_data| and - // clears the default value. - void Reset(const NetworkUIData& ui_data); + ~NetworkPropertyUIData(); // Update the property object from dictionary, reading the key given by // |property_key|. - void ParseOncProperty(const NetworkUIData& ui_data, + void ParseOncProperty(onc::ONCSource onc_source, const base::DictionaryValue* onc, const std::string& property_key); const base::Value* default_value() const { return default_value_.get(); } - bool managed() const { return controller_ == CONTROLLER_POLICY; } - bool recommended() const { - return controller_ == CONTROLLER_USER && default_value_.get(); + bool IsManaged() const { + return (onc_source_ == onc::ONC_SOURCE_DEVICE_POLICY || + onc_source_ == onc::ONC_SOURCE_USER_POLICY); } - bool editable() const { return controller_ == CONTROLLER_USER; } + bool IsEditable() const { return !IsManaged(); } private: - Controller controller_; + onc::ONCSource onc_source_; scoped_ptr<base::Value> default_value_; - static const char kKeyController[]; - static const char kKeyDefaultValue[]; - - // So it can access the kKeyXYZ constants. - friend class NetworkUIDataTest; - DISALLOW_COPY_AND_ASSIGN(NetworkPropertyUIData); }; diff --git a/chrome/browser/chromeos/cros/network_property_ui_data_unittest.cc b/chrome/browser/chromeos/cros/network_property_ui_data_unittest.cc index 3cadc2a..3a4b400 100644 --- a/chrome/browser/chromeos/cros/network_property_ui_data_unittest.cc +++ b/chrome/browser/chromeos/cros/network_property_ui_data_unittest.cc @@ -5,20 +5,19 @@ #include "chrome/browser/chromeos/cros/network_property_ui_data.h" #include "base/values.h" -#include "chromeos/network/network_ui_data.h" +#include "chromeos/network/onc/onc_constants.h" #include "testing/gtest/include/gtest/gtest.h" namespace chromeos { -class NetworkUIDataTest : public testing::Test { +class NetworkPropertyUIDataTest : public testing::Test { protected: - NetworkUIDataTest() {} - virtual ~NetworkUIDataTest() {} + NetworkPropertyUIDataTest() {} + virtual ~NetworkPropertyUIDataTest() {} void CheckProperty(const NetworkPropertyUIData& property, const base::Value* expected_default_value, bool expected_managed, - bool expected_recommended, bool expected_editable) { if (expected_default_value) { EXPECT_TRUE(base::Value::Equals(expected_default_value, @@ -26,31 +25,20 @@ class NetworkUIDataTest : public testing::Test { } else { EXPECT_FALSE(property.default_value()); } - EXPECT_EQ(expected_managed, property.managed()); - EXPECT_EQ(expected_recommended, property.recommended()); - EXPECT_EQ(expected_editable, property.editable()); + EXPECT_EQ(expected_managed, property.IsManaged()); + EXPECT_EQ(expected_editable, property.IsEditable()); } }; -TEST_F(NetworkUIDataTest, PropertyInit) { +TEST_F(NetworkPropertyUIDataTest, PropertyInit) { NetworkPropertyUIData empty_prop; - CheckProperty(empty_prop, NULL, false, false, true); - - NetworkUIData empty_data; - NetworkPropertyUIData null_prop(empty_data); - CheckProperty(null_prop, NULL, false, false, true); - - base::DictionaryValue empty_dict; - NetworkUIData empty_data_2(empty_dict); - NetworkPropertyUIData empty_dict_prop(empty_data_2); - CheckProperty(empty_dict_prop, NULL, false, false, true); + CheckProperty(empty_prop, NULL, false, true); + NetworkPropertyUIData null_prop(onc::ONC_SOURCE_NONE); + CheckProperty(null_prop, NULL, false, true); } -TEST_F(NetworkUIDataTest, ParseOncProperty) { - base::DictionaryValue ui_data_dict; - NetworkUIData ui_data; - +TEST_F(NetworkPropertyUIDataTest, ParseOncProperty) { base::DictionaryValue onc; base::StringValue val_a("a"); @@ -63,59 +51,56 @@ TEST_F(NetworkUIDataTest, ParseOncProperty) { onc.Set("a.a", val_a_a.DeepCopy()); onc.Set("a.b", val_a_b.DeepCopy()); base::ListValue recommended; - recommended.Append(new base::StringValue("b")); - recommended.Append(new base::StringValue("c")); - recommended.Append(new base::StringValue("a.a")); + recommended.AppendString("b"); + recommended.AppendString("c"); + recommended.AppendString("a.a"); onc.Set("Recommended", recommended.DeepCopy()); onc.Set("a.Recommended", recommended.DeepCopy()); NetworkPropertyUIData prop; - ui_data.set_onc_source(onc::ONC_SOURCE_USER_IMPORT); - ui_data.FillDictionary(&ui_data_dict); + prop.ParseOncProperty(onc::ONC_SOURCE_NONE, &onc, "a"); + CheckProperty(prop, NULL, false, true); - NetworkUIData empty_data; - prop.ParseOncProperty(empty_data, &onc, "a"); - CheckProperty(prop, NULL, false, false, true); + onc::ONCSource source = onc::ONC_SOURCE_USER_IMPORT; - prop.ParseOncProperty(ui_data, &onc, "a"); - CheckProperty(prop, NULL, false, false, true); + prop.ParseOncProperty(source, &onc, "a"); + CheckProperty(prop, NULL, false, true); - prop.ParseOncProperty(ui_data, &onc, "a.b"); - CheckProperty(prop, NULL, false, false, true); + prop.ParseOncProperty(source, &onc, "a.b"); + CheckProperty(prop, NULL, false, true); - prop.ParseOncProperty(ui_data, &onc, "c"); - CheckProperty(prop, NULL, false, false, true); + prop.ParseOncProperty(source, &onc, "c"); + CheckProperty(prop, NULL, false, true); - ui_data.set_onc_source(onc::ONC_SOURCE_USER_POLICY); - ui_data.FillDictionary(&ui_data_dict); + source = onc::ONC_SOURCE_USER_POLICY; - prop.ParseOncProperty(ui_data, &onc, "a"); - CheckProperty(prop, NULL, true, false, false); + prop.ParseOncProperty(source, &onc, "a"); + CheckProperty(prop, NULL, true, false); - prop.ParseOncProperty(ui_data, &onc, "b"); - CheckProperty(prop, &val_b, false, true, true); + prop.ParseOncProperty(source, &onc, "b"); + CheckProperty(prop, &val_b, false, true); - prop.ParseOncProperty(ui_data, &onc, "c"); - CheckProperty(prop, NULL, false, false, true); + prop.ParseOncProperty(source, &onc, "c"); + CheckProperty(prop, NULL, false, true); - prop.ParseOncProperty(ui_data, &onc, "d"); - CheckProperty(prop, NULL, true, false, false); + prop.ParseOncProperty(source, &onc, "d"); + CheckProperty(prop, NULL, true, false); - prop.ParseOncProperty(ui_data, &onc, "a.a"); - CheckProperty(prop, NULL, true, false, false); + prop.ParseOncProperty(source, &onc, "a.a"); + CheckProperty(prop, NULL, true, false); - prop.ParseOncProperty(ui_data, &onc, "a.b"); - CheckProperty(prop, &val_a_b, false, true, true); + prop.ParseOncProperty(source, &onc, "a.b"); + CheckProperty(prop, &val_a_b, false, true); - prop.ParseOncProperty(ui_data, &onc, "a.c"); - CheckProperty(prop, NULL, false, false, true); + prop.ParseOncProperty(source, &onc, "a.c"); + CheckProperty(prop, NULL, false, true); - prop.ParseOncProperty(ui_data, &onc, "a.d"); - CheckProperty(prop, NULL, true, false, false); + prop.ParseOncProperty(source, &onc, "a.d"); + CheckProperty(prop, NULL, true, false); - prop.ParseOncProperty(ui_data, NULL, "a.e"); - CheckProperty(prop, NULL, true, false, false); + prop.ParseOncProperty(source, NULL, "a.e"); + CheckProperty(prop, NULL, true, false); } } // namespace chromeos diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc index b597761..8794e7e 100644 --- a/chrome/browser/chromeos/options/network_config_view.cc +++ b/chrome/browser/chromeos/options/network_config_view.cc @@ -272,10 +272,10 @@ ControlledSettingIndicatorView::~ControlledSettingIndicatorView() {} void ControlledSettingIndicatorView::Update( const NetworkPropertyUIData& ui_data) { - if (managed_ == ui_data.managed()) + if (managed_ == ui_data.IsManaged()) return; - managed_ = ui_data.managed(); + managed_ = ui_data.IsManaged(); PreferredSizeChanged(); } diff --git a/chrome/browser/chromeos/options/vpn_config_view.cc b/chrome/browser/chromeos/options/vpn_config_view.cc index c355e4b..b73515c 100644 --- a/chrome/browser/chromeos/options/vpn_config_view.cc +++ b/chrome/browser/chromeos/options/vpn_config_view.cc @@ -8,9 +8,11 @@ #include "base/stringprintf.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/cros/cros_library.h" +#include "chrome/browser/chromeos/cros/network_library.h" #include "chrome/browser/chromeos/enrollment_dialog_view.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/net/x509_certificate_model.h" +#include "chromeos/network/network_ui_data.h" #include "chromeos/network/onc/onc_constants.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -626,7 +628,7 @@ void VPNConfigView::Init(VirtualNetwork* vpn) { IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_USERNAME))); username_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); username_textfield_->SetController(this); - username_textfield_->SetEnabled(username_ui_data_.editable()); + username_textfield_->SetEnabled(username_ui_data_.IsEditable()); if (vpn && !vpn->username().empty()) username_textfield_->SetText(UTF8ToUTF16(vpn->username())); layout->AddView(username_textfield_); @@ -640,7 +642,7 @@ void VPNConfigView::Init(VirtualNetwork* vpn) { bool has_user_passphrase = vpn && !vpn->IsUserPassphraseRequired(); user_passphrase_textfield_ = new PassphraseTextfield(has_user_passphrase); user_passphrase_textfield_->SetController(this); - user_passphrase_textfield_->SetEnabled(user_passphrase_ui_data_.editable()); + user_passphrase_textfield_->SetEnabled(user_passphrase_ui_data_.IsEditable()); layout->AddView(user_passphrase_textfield_); layout->AddView(new ControlledSettingIndicatorView(user_passphrase_ui_data_)); layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); @@ -684,7 +686,8 @@ void VPNConfigView::Init(VirtualNetwork* vpn) { save_credentials_checkbox_ = new views::Checkbox( l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SAVE_CREDENTIALS)); - save_credentials_checkbox_->SetEnabled(save_credentials_ui_data_.editable()); + save_credentials_checkbox_->SetEnabled( + save_credentials_ui_data_.IsEditable()); bool save_credentials = vpn ? vpn->save_credentials() : false; save_credentials_checkbox_->SetChecked(save_credentials); layout->SkipColumns(1); @@ -782,19 +785,19 @@ void VPNConfigView::UpdateControls() { psk_passphrase_label_->SetEnabled(enable_psk_passphrase_); if (psk_passphrase_textfield_) psk_passphrase_textfield_->SetEnabled(enable_psk_passphrase_ && - psk_passphrase_ui_data_.editable()); + psk_passphrase_ui_data_.IsEditable()); if (user_cert_label_) user_cert_label_->SetEnabled(enable_user_cert_); if (user_cert_combobox_) user_cert_combobox_->SetEnabled(enable_user_cert_ && - user_cert_ui_data_.editable()); + user_cert_ui_data_.IsEditable()); if (server_ca_cert_label_) server_ca_cert_label_->SetEnabled(enable_server_ca_cert_); if (server_ca_cert_combobox_) server_ca_cert_combobox_->SetEnabled(enable_server_ca_cert_ && - ca_cert_ui_data_.editable()); + ca_cert_ui_data_.IsEditable()); if (otp_label_) otp_label_->SetEnabled(enable_otp_); @@ -805,7 +808,7 @@ void VPNConfigView::UpdateControls() { group_name_label_->SetEnabled(enable_group_name_); if (group_name_textfield_) group_name_textfield_->SetEnabled(enable_group_name_ && - group_name_ui_data_.editable()); + group_name_ui_data_.IsEditable()); } void VPNConfigView::UpdateErrorLabel() { @@ -897,7 +900,7 @@ void VPNConfigView::ParseVPNUIProperty(NetworkPropertyUIData* property_ui_data, VLOG_IF(1, !onc) << "No ONC found for VPN network " << network->unique_id(); property_ui_data->ParseOncProperty( - network->ui_data(), onc, + network->ui_data().onc_source(), onc, base::StringPrintf("%s.%s.%s", onc::network_config::kVPN, dict_key.c_str(), diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc index 7d372ed..9559ca6 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.cc +++ b/chrome/browser/chromeos/options/wifi_config_view.cc @@ -12,6 +12,7 @@ #include "chrome/browser/chromeos/enrollment_dialog_view.h" #include "chrome/browser/profiles/profile_manager.h" #include "chromeos/login/login_state.h" +#include "chromeos/network/network_ui_data.h" #include "chromeos/network/onc/onc_constants.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -480,13 +481,13 @@ void WifiConfigView::RefreshEapFields() { phase_2_auth_combobox_->SetSelectedIndex(0); bool phase_2_auth_enabled = Phase2AuthActive(); phase_2_auth_combobox_->SetEnabled(phase_2_auth_enabled && - phase_2_auth_ui_data_.editable()); + phase_2_auth_ui_data_.IsEditable()); phase_2_auth_label_->SetEnabled(phase_2_auth_enabled); // Passphrase. bool passphrase_enabled = PassphraseActive(); passphrase_textfield_->SetEnabled(passphrase_enabled && - passphrase_ui_data_.editable()); + passphrase_ui_data_.IsEditable()); passphrase_label_->SetEnabled(passphrase_enabled); if (!passphrase_enabled) passphrase_textfield_->SetText(string16()); @@ -498,7 +499,7 @@ void WifiConfigView::RefreshEapFields() { bool have_user_certs = !certs_loading && HaveUserCerts(); user_cert_combobox_->SetEnabled(user_cert_enabled && have_user_certs && - user_cert_ui_data_.editable()); + user_cert_ui_data_.IsEditable()); user_cert_combobox_->ModelChanged(); user_cert_combobox_->SetSelectedIndex(0); @@ -507,14 +508,14 @@ void WifiConfigView::RefreshEapFields() { server_ca_cert_label_->SetEnabled(ca_cert_enabled); server_ca_cert_combobox_->SetEnabled(ca_cert_enabled && !certs_loading && - server_ca_cert_ui_data_.editable()); + server_ca_cert_ui_data_.IsEditable()); server_ca_cert_combobox_->ModelChanged(); server_ca_cert_combobox_->SetSelectedIndex(0); // No anonymous identity if no phase 2 auth. bool identity_anonymous_enabled = phase_2_auth_enabled; identity_anonymous_textfield_->SetEnabled( - identity_anonymous_enabled && identity_anonymous_ui_data_.editable()); + identity_anonymous_enabled && identity_anonymous_ui_data_.IsEditable()); identity_anonymous_label_->SetEnabled(identity_anonymous_enabled); if (!identity_anonymous_enabled) identity_anonymous_textfield_->SetText(string16()); @@ -627,7 +628,7 @@ void WifiConfigView::OnSelectedIndexChanged(views::Combobox* combobox) { bool passphrase_enabled = PassphraseActive(); passphrase_label_->SetEnabled(passphrase_enabled); passphrase_textfield_->SetEnabled(passphrase_enabled && - passphrase_ui_data_.editable()); + passphrase_ui_data_.IsEditable()); if (!passphrase_enabled) passphrase_textfield_->SetText(string16()); RefreshShareCheckbox(); @@ -854,7 +855,7 @@ void WifiConfigView::Init(WifiNetwork* wifi, bool show_8021x) { ParseWiFiEAPUIProperty(&user_cert_ui_data_, wifi, onc::eap::kClientCertRef); ParseWiFiEAPUIProperty(&server_ca_cert_ui_data_, wifi, onc::eap::kServerCARef); - if (server_ca_cert_ui_data_.managed()) { + if (server_ca_cert_ui_data_.IsManaged()) { ParseWiFiEAPUIProperty(&server_ca_cert_ui_data_, wifi, onc::eap::kUseSystemCAs); } @@ -943,7 +944,7 @@ void WifiConfigView::Init(WifiNetwork* wifi, bool show_8021x) { eap_method_combobox_model_.get()); eap_method_combobox_->SetAccessibleName(eap_label_text); eap_method_combobox_->set_listener(this); - eap_method_combobox_->SetEnabled(eap_method_ui_data_.editable()); + eap_method_combobox_->SetEnabled(eap_method_ui_data_.IsEditable()); layout->AddView(eap_method_combobox_); layout->AddView(new ControlledSettingIndicatorView(eap_method_ui_data_)); layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); @@ -1014,7 +1015,7 @@ void WifiConfigView::Init(WifiNetwork* wifi, bool show_8021x) { identity_textfield_->SetController(this); if (wifi && !wifi->identity().empty()) identity_textfield_->SetText(UTF8ToUTF16(wifi->identity())); - identity_textfield_->SetEnabled(identity_ui_data_.editable()); + identity_textfield_->SetEnabled(identity_ui_data_.IsEditable()); layout->AddView(identity_textfield_); layout->AddView(new ControlledSettingIndicatorView(identity_ui_data_)); layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); @@ -1033,11 +1034,11 @@ void WifiConfigView::Init(WifiNetwork* wifi, bool show_8021x) { passphrase_textfield_->SetText(UTF8ToUTF16(wifi->GetPassphrase())); // Disable passphrase input initially for other network. passphrase_label_->SetEnabled(wifi != NULL); - passphrase_textfield_->SetEnabled(wifi && passphrase_ui_data_.editable()); + passphrase_textfield_->SetEnabled(wifi && passphrase_ui_data_.IsEditable()); passphrase_textfield_->SetAccessibleName(passphrase_label_text); layout->AddView(passphrase_textfield_); - if (passphrase_ui_data_.managed()) { + if (passphrase_ui_data_.IsManaged()) { layout->AddView(new ControlledSettingIndicatorView(passphrase_ui_data_)); } else { // Password visible button. @@ -1099,7 +1100,7 @@ void WifiConfigView::Init(WifiNetwork* wifi, bool show_8021x) { l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SAVE_CREDENTIALS)); save_credentials_checkbox_->SetEnabled( - save_credentials_ui_data_.editable()); + save_credentials_ui_data_.IsEditable()); layout->SkipColumns(1); layout->AddView(save_credentials_checkbox_); layout->AddView( @@ -1253,7 +1254,7 @@ void WifiConfigView::ParseWiFiUIProperty( const std::string& key) { NetworkLibrary* network_library = CrosLibrary::Get()->GetNetworkLibrary(); property_ui_data->ParseOncProperty( - network->ui_data(), + network->ui_data().onc_source(), network_library->FindOncForNetwork(network->unique_id()), base::StringPrintf("%s.%s", onc::network_config::kWiFi, key.c_str())); } diff --git a/chrome/browser/chromeos/options/wimax_config_view.cc b/chrome/browser/chromeos/options/wimax_config_view.cc index 5705583..524c6fb 100644 --- a/chrome/browser/chromeos/options/wimax_config_view.cc +++ b/chrome/browser/chromeos/options/wimax_config_view.cc @@ -238,7 +238,7 @@ void WimaxConfigView::Init(WimaxNetwork* wimax) { identity_textfield_->SetController(this); const std::string& eap_identity = wimax->eap_identity(); identity_textfield_->SetText(UTF8ToUTF16(eap_identity)); - identity_textfield_->SetEnabled(identity_ui_data_.editable()); + identity_textfield_->SetEnabled(identity_ui_data_.IsEditable()); layout->AddView(identity_textfield_); layout->AddView(new ControlledSettingIndicatorView(identity_ui_data_)); layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); @@ -253,11 +253,11 @@ void WimaxConfigView::Init(WimaxNetwork* wimax) { views::Textfield::STYLE_OBSCURED); passphrase_textfield_->SetController(this); passphrase_label_->SetEnabled(true); - passphrase_textfield_->SetEnabled(passphrase_ui_data_.editable()); + passphrase_textfield_->SetEnabled(passphrase_ui_data_.IsEditable()); passphrase_textfield_->SetAccessibleName(passphrase_label_text); layout->AddView(passphrase_textfield_); - if (passphrase_ui_data_.managed()) { + if (passphrase_ui_data_.IsManaged()) { layout->AddView(new ControlledSettingIndicatorView(passphrase_ui_data_)); } else { // Password visible button. @@ -301,7 +301,7 @@ void WimaxConfigView::Init(WimaxNetwork* wimax) { l10n_util::GetStringUTF16( IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SAVE_CREDENTIALS)); save_credentials_checkbox_->SetEnabled( - save_credentials_ui_data_.editable()); + save_credentials_ui_data_.IsEditable()); save_credentials_checkbox_->SetChecked(wimax->save_credentials()); layout->SkipColumns(1); layout->AddView(save_credentials_checkbox_); diff --git a/chrome/browser/chromeos/proxy_config_service_impl.cc b/chrome/browser/chromeos/proxy_config_service_impl.cc index 71ba976..37a2bc9 100644 --- a/chrome/browser/chromeos/proxy_config_service_impl.cc +++ b/chrome/browser/chromeos/proxy_config_service_impl.cc @@ -108,10 +108,10 @@ bool IsNetworkProxySettingsEditable(const Network* network) { NetworkPropertyUIData proxy_settings_ui_data; proxy_settings_ui_data.ParseOncProperty( - network->ui_data(), + network->ui_data().onc_source(), onc, onc::network_config::kProxySettings); - return proxy_settings_ui_data.editable(); + return proxy_settings_ui_data.IsEditable(); } // Only unblock if needed for debugging. |