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

Unified Diff: chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc

Issue 8467012: Refactor proxy handling for ChromeOS to not go through the CrosSettings interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One file slipped away. Created 9 years, 1 month 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/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..dc78e10e3a80c7e15950eb475187d469a3a2f96a 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_tracker = GetProfile()->GetProxyConfigTracker();
+ proxy_tracker->UIMakeActiveNetworkCurrent();
+ std::string network_name;
+ proxy_tracker->UIGetCurrentNetworkName(&network_name);
+ proxy_handler_->SetNetworkName(network_name);
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698