Chromium Code Reviews| Index: chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc |
| diff --git a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc |
| index 8c06afbb5cfc486ad87be590213b31906c49acf8..c2ae15e4661f264e0f169eb8f66a19228fe8f862 100644 |
| --- a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc |
| +++ b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/message_loop.h" |
| #include "base/values.h" |
| #include "chrome/browser/chromeos/cros_settings.h" |
| +#include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| #include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.h" |
| @@ -65,8 +66,7 @@ namespace chromeos { |
| ProxySettingsUI::ProxySettingsUI(TabContents* contents) |
| : ChromeWebUI(contents), |
| - proxy_settings_(NULL), |
| - proxy_handler_(new ProxyHandler(GetProfile())) { |
| + proxy_handler_(new ProxyHandler()) { |
| // |localized_strings| will be owned by ProxySettingsHTMLSource. |
| DictionaryValue* localized_strings = new DictionaryValue(); |
| @@ -101,23 +101,11 @@ void ProxySettingsUI::InitializeHandlers() { |
| for (iter = handlers_.begin() + 1; iter != handlers_.end(); ++iter) { |
| (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); |
| } |
| - if (proxy_settings()) { |
| - proxy_settings()->MakeActiveNetworkCurrent(); |
| - std::string network_name; |
| - GetProfile()->GetProxyConfigTracker()->UIGetCurrentNetworkName( |
| - &network_name); |
| - proxy_handler_->SetNetworkName(network_name); |
| - } |
| -} |
| - |
| -chromeos::ProxyCrosSettingsProvider* ProxySettingsUI::proxy_settings() { |
| - if (!proxy_settings_) { |
| - proxy_settings_ = static_cast<chromeos::ProxyCrosSettingsProvider*>( |
| - chromeos::CrosSettings::Get()->GetProvider("cros.session.proxy")); |
| - if (!proxy_settings_) |
| - NOTREACHED() << "Error getting access to proxy cros settings provider"; |
| - } |
| - return proxy_settings_; |
| + PrefProxyConfigTracker* proxy_config = GetProfile()->GetProxyConfigTracker(); |
|
kuan
2011/11/10 14:27:25
hm... maybe use proxy_tracker?
pastarmovj
2011/11/10 16:08:26
Done.
|
| + proxy_config->UIMakeActiveNetworkCurrent(); |
| + std::string network_name; |
| + proxy_config->UIGetCurrentNetworkName(&network_name); |
| + proxy_handler_->SetNetworkName(network_name); |
| } |
| } // namespace chromeos |