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

Side by Side Diff: chrome/browser/chromeos/proxy_cros_settings_provider.cc

Issue 6292017: Extended: Add "system" URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 years, 9 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/chromeos/proxy_cros_settings_provider.h" 5 #include "chrome/browser/chromeos/proxy_cros_settings_provider.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "chrome/browser/browser_list.h" 9 #include "chrome/browser/browser_list.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/profiles/profile_manager.h"
12 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
13 12
14 namespace chromeos { 13 namespace chromeos {
15 14
16 static const char kProxyPacUrl[] = "cros.session.proxy.pacurl"; 15 static const char kProxyPacUrl[] = "cros.session.proxy.pacurl";
17 static const char kProxySingleHttp[] = "cros.session.proxy.singlehttp"; 16 static const char kProxySingleHttp[] = "cros.session.proxy.singlehttp";
18 static const char kProxySingleHttpPort[] = "cros.session.proxy.singlehttpport"; 17 static const char kProxySingleHttpPort[] = "cros.session.proxy.singlehttpport";
19 static const char kProxyHttpUrl[] = "cros.session.proxy.httpurl"; 18 static const char kProxyHttpUrl[] = "cros.session.proxy.httpurl";
20 static const char kProxyHttpPort[] = "cros.session.proxy.httpport"; 19 static const char kProxyHttpPort[] = "cros.session.proxy.httpport";
21 static const char kProxyHttpsUrl[] = "cros.session.proxy.httpsurl"; 20 static const char kProxyHttpsUrl[] = "cros.session.proxy.httpsurl";
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 284 }
286 285
287 bool ProxyCrosSettingsProvider::HandlesSetting(const std::string& path) { 286 bool ProxyCrosSettingsProvider::HandlesSetting(const std::string& path) {
288 return ::StartsWithASCII(path, "cros.session.proxy", true); 287 return ::StartsWithASCII(path, "cros.session.proxy", true);
289 } 288 }
290 289
291 //----------------- ProxyCrosSettingsProvider: private methods ----------------- 290 //----------------- ProxyCrosSettingsProvider: private methods -----------------
292 291
293 chromeos::ProxyConfigServiceImpl* 292 chromeos::ProxyConfigServiceImpl*
294 ProxyCrosSettingsProvider::GetConfigService() const { 293 ProxyCrosSettingsProvider::GetConfigService() const {
295 Browser* browser = BrowserList::GetLastActive(); 294 return g_browser_process->chromeos_proxy_config_service_impl();
296 // browser is NULL at OOBE/login stage.
297 Profile* profile = browser ?
298 browser->profile() :
299 ProfileManager::GetDefaultProfile();
300 return profile->GetChromeOSProxyConfigServiceImpl();
301 } 295 }
302 296
303 void ProxyCrosSettingsProvider::AppendPortIfValid( 297 void ProxyCrosSettingsProvider::AppendPortIfValid(
304 const char* port_cache_key, 298 const char* port_cache_key,
305 std::string* server_uri) { 299 std::string* server_uri) {
306 std::string port; 300 std::string port;
307 if (!server_uri->empty() && cache_.GetString(port_cache_key, &port) && 301 if (!server_uri->empty() && cache_.GetString(port_cache_key, &port) &&
308 !port.empty()) { 302 !port.empty()) {
309 *server_uri += ":" + port; 303 *server_uri += ":" + port;
310 } 304 }
(...skipping 20 matching lines...) Expand all
331 Value::CreateIntegerValue(proxy.server.host_port_pair().port()) : 325 Value::CreateIntegerValue(proxy.server.host_port_pair().port()) :
332 NULL; 326 NULL;
333 } 327 }
334 328
335 void ProxyCrosSettingsProvider::SetCache(const std::string& key, 329 void ProxyCrosSettingsProvider::SetCache(const std::string& key,
336 const Value* value) { 330 const Value* value) {
337 cache_.Set(key, value->DeepCopy()); 331 cache_.Set(key, value->DeepCopy());
338 } 332 }
339 333
340 } // namespace chromeos 334 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/proxy_config_service_impl.h ('k') | chrome/browser/google/google_url_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698