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

Side by Side Diff: chrome/browser/ui/webui/chromeos/proxy_settings_ui.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/chromeos/proxy_settings_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/proxy_settings_ui.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chromeos/cros_settings.h" 10 #include "chrome/browser/chromeos/cros_settings.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 proxy_handler_ = NULL; // Weak ptr that is owned by base class, nullify it. 95 proxy_handler_ = NULL; // Weak ptr that is owned by base class, nullify it.
96 } 96 }
97 97
98 void ProxySettingsUI::InitializeHandlers() { 98 void ProxySettingsUI::InitializeHandlers() {
99 std::vector<WebUIMessageHandler*>::iterator iter; 99 std::vector<WebUIMessageHandler*>::iterator iter;
100 // Skip over the generic handler. 100 // Skip over the generic handler.
101 for (iter = handlers_.begin() + 1; iter != handlers_.end(); ++iter) { 101 for (iter = handlers_.begin() + 1; iter != handlers_.end(); ++iter) {
102 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); 102 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize();
103 } 103 }
104 if (proxy_settings()) { 104 if (proxy_settings()) {
105 proxy_settings()->MakeActiveNetworkCurrent(); 105 proxy_settings()->MakeActiveNetworkCurrentWithProfile(GetProfile());
106 std::string network = proxy_settings()->GetCurrentNetworkName(); 106 std::string network = proxy_settings()->GetCurrentNetworkName();
107 if (!network.empty()) 107 proxy_handler_->SetNetworkName(network);
108 proxy_handler_->SetNetworkName(network);
109 } 108 }
110 } 109 }
111 110
112 chromeos::ProxyCrosSettingsProvider* ProxySettingsUI::proxy_settings() { 111 chromeos::ProxyCrosSettingsProvider* ProxySettingsUI::proxy_settings() {
113 if (!proxy_settings_) { 112 if (!proxy_settings_) {
114 proxy_settings_ = static_cast<chromeos::ProxyCrosSettingsProvider*>( 113 proxy_settings_ = static_cast<chromeos::ProxyCrosSettingsProvider*>(
115 chromeos::CrosSettings::Get()->GetProvider("cros.session.proxy")); 114 chromeos::CrosSettings::Get()->GetProvider("cros.session.proxy"));
116 if (!proxy_settings_) 115 if (!proxy_settings_)
117 NOTREACHED() << "Error getting access to proxy cros settings provider"; 116 NOTREACHED() << "Error getting access to proxy cros settings provider";
118 } 117 }
119 return proxy_settings_; 118 return proxy_settings_;
120 } 119 }
121 120
122 } // namespace chromeos 121 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698