| Index: chrome/browser/chromeos/proxy_cros_settings_provider.cc
|
| ===================================================================
|
| --- chrome/browser/chromeos/proxy_cros_settings_provider.cc (revision 103881)
|
| +++ chrome/browser/chromeos/proxy_cros_settings_provider.cc (working copy)
|
| @@ -47,24 +47,20 @@
|
|
|
| ProxyCrosSettingsProvider::ProxyCrosSettingsProvider() { }
|
|
|
| -void ProxyCrosSettingsProvider::SetCurrentNetwork(const std::string& network) {
|
| - if (!GetConfigService()->UISetCurrentNetwork(network))
|
| - return;
|
| +void ProxyCrosSettingsProvider::SetCurrentNetworkWithProfile(
|
| + const std::string& network, Profile* profile) {
|
| + GetConfigService()->UISetCurrentNetworkWithProfile(network, profile);
|
| for (size_t i = 0; i < arraysize(kProxySettings); ++i)
|
| CrosSettings::Get()->FireObservers(kProxySettings[i]);
|
| }
|
|
|
| -void ProxyCrosSettingsProvider::MakeActiveNetworkCurrent() {
|
| - if (!GetConfigService()->UIMakeActiveNetworkCurrent())
|
| - return;
|
| +void ProxyCrosSettingsProvider::MakeActiveNetworkCurrentWithProfile(
|
| + Profile* profile) {
|
| + GetConfigService()->UIMakeActiveNetworkCurrentWithProfile(profile);
|
| for (size_t i = 0; i < arraysize(kProxySettings); ++i)
|
| CrosSettings::Get()->FireObservers(kProxySettings[i]);
|
| }
|
|
|
| -bool ProxyCrosSettingsProvider::IsUsingSharedProxies() const {
|
| - return GetConfigService()->use_shared_proxies();
|
| -}
|
| -
|
| const std::string& ProxyCrosSettingsProvider::GetCurrentNetworkName() const {
|
| return GetConfigService()->current_network_name();
|
| }
|
| @@ -235,6 +231,7 @@
|
| Value** out_value) const {
|
| bool found = false;
|
| bool managed = false;
|
| + std::string controlled_by;
|
| Value* data = NULL;
|
| chromeos::ProxyConfigServiceImpl* config_service = GetConfigService();
|
| chromeos::ProxyConfigServiceImpl::ProxyConfig config;
|
| @@ -274,6 +271,19 @@
|
| } else {
|
| data = Value::CreateIntegerValue(1);
|
| }
|
| + switch (config.source) {
|
| + case ProxyConfigServiceImpl::ProxyConfig::SOURCE_POLICY:
|
| + case ProxyConfigServiceImpl::ProxyConfig::SOURCE_RECOMMENDED:
|
| + controlled_by = "policyManagedPrefsBannerText";
|
| + break;
|
| + case ProxyConfigServiceImpl::ProxyConfig::SOURCE_EXTENSION:
|
| + controlled_by = "extensionManagedPrefsBannerText";
|
| + break;
|
| + default:
|
| + if (!config.IsUserModifiable())
|
| + controlled_by = "enableSharedProxiesBannerText";
|
| + break;
|
| + }
|
| found = true;
|
| } else if (path == kProxySingle) {
|
| data = Value::CreateBooleanValue(config.mode ==
|
| @@ -312,6 +322,10 @@
|
| data = Value::CreateStringValue("");
|
| dict->Set("value", data);
|
| dict->SetBoolean("managed", managed);
|
| + if (path == kProxyType) {
|
| + dict->SetString("controlledBy", controlled_by);
|
| + dict->SetBoolean("disabled", !config.IsUserModifiable());
|
| + }
|
| *out_value = dict;
|
| return true;
|
| } else {
|
|
|