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

Unified Diff: chrome/browser/chromeos/proxy_cros_settings_provider.cc

Issue 8102019: redesign and reimplement proxy config service and tracker, revise proxy ui on cros (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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/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) {
stevenjb 2011/10/05 00:22:57 This logic would need to change if config.source w
kuan 2011/10/07 00:30:41 Done.
+ case ProxyConfigServiceImpl::ProxyConfig::SOURCE_POLICY:
+ case ProxyConfigServiceImpl::ProxyConfig::SOURCE_RECOMMENDED:
Mattias Nissler (ping if slow) 2011/10/05 10:18:36 I think this is misleading, since the banner is th
kuan 2011/10/07 00:30:41 this didn't from me; it comes from sumit and kenmo
Mattias Nissler (ping if slow) 2011/10/07 13:32:10 It seems I misunderstood this. The point here is t
+ 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) {
Mattias Nissler (ping if slow) 2011/10/07 13:32:10 why only for the type?
+ dict->SetString("controlledBy", controlled_by);
+ dict->SetBoolean("disabled", !config.IsUserModifiable());
+ }
*out_value = dict;
return true;
} else {

Powered by Google App Engine
This is Rietveld 408576698