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

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)
@@ -7,6 +7,7 @@
#include "base/string_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/cros_settings.h"
+#include "chrome/browser/net/pref_proxy_config_service.h"
#include "chrome/browser/ui/browser_list.h"
namespace chromeos {
@@ -47,24 +48,22 @@
ProxyCrosSettingsProvider::ProxyCrosSettingsProvider() { }
+void ProxyCrosSettingsProvider::SetCurrentUserProfile(Profile* profile) {
+ GetConfigService()->UISetCurrentUserProfile(profile);
+}
+
void ProxyCrosSettingsProvider::SetCurrentNetwork(const std::string& network) {
- if (!GetConfigService()->UISetCurrentNetwork(network))
- return;
+ GetConfigService()->UISetCurrentNetwork(network);
for (size_t i = 0; i < arraysize(kProxySettings); ++i)
CrosSettings::Get()->FireObservers(kProxySettings[i]);
}
void ProxyCrosSettingsProvider::MakeActiveNetworkCurrent() {
- if (!GetConfigService()->UIMakeActiveNetworkCurrent())
- return;
+ GetConfigService()->UIMakeActiveNetworkCurrent();
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 +234,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 +274,22 @@
} else {
data = Value::CreateIntegerValue(1);
}
+ switch (config.source) {
+ case PrefProxyConfigTracker::CONFIG_SOURCE_POLICY:
+ controlled_by = "policyManagedPrefsBannerText";
+ break;
+ case PrefProxyConfigTracker::CONFIG_SOURCE_EXTENSION:
+ controlled_by = "extensionManagedPrefsBannerText";
+ break;
+ case PrefProxyConfigTracker::CONFIG_SOURCE_FALLBACK:
+ controlled_by = config.user_modifiable ?
+ "policyManagedPrefsBannerText" : "enableSharedProxiesBannerText";
+ break;
+ default:
+ if (!config.user_modifiable)
+ controlled_by = "enableSharedProxiesBannerText";
+ break;
+ }
found = true;
} else if (path == kProxySingle) {
data = Value::CreateBooleanValue(config.mode ==
@@ -312,6 +328,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 kProxyType?
kuan 2011/10/18 16:25:35 this is because all the other input fields are ena
+ dict->SetString("controlledBy", controlled_by);
+ dict->SetBoolean("disabled", !config.user_modifiable);
+ }
*out_value = dict;
return true;
} else {

Powered by Google App Engine
This is Rietveld 408576698