OLD | NEW |
---|---|
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/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/browser_thread.h" | 12 #include "chrome/browser/browser_thread.h" |
13 #include "chrome/browser/extensions/user_script_master.h" | |
13 #include "chrome/browser/io_thread.h" | 14 #include "chrome/browser/io_thread.h" |
14 #include "chrome/browser/net/chrome_cookie_notification_details.h" | 15 #include "chrome/browser/net/chrome_cookie_notification_details.h" |
15 #include "chrome/browser/net/pref_proxy_config_service.h" | 16 #include "chrome/browser/net/pref_proxy_config_service.h" |
17 #include "chrome/browser/prefs/pref_service.h" | |
16 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/prefs/pref_service.h" | |
18 #include "chrome/browser/extensions/user_script_master.h" | |
19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/common/notification_service.h" | 20 #include "chrome/common/notification_service.h" |
21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
22 #include "net/http/http_util.h" | 22 #include "net/http/http_util.h" |
23 #include "net/proxy/proxy_config_service_fixed.h" | 23 #include "net/proxy/proxy_config_service_fixed.h" |
24 #include "net/proxy/proxy_script_fetcher_impl.h" | 24 #include "net/proxy/proxy_script_fetcher_impl.h" |
25 #include "net/proxy/proxy_service.h" | 25 #include "net/proxy/proxy_service.h" |
26 | 26 |
27 #if defined(OS_CHROMEOS) | 27 #if defined(OS_CHROMEOS) |
28 #include "chrome/browser/chromeos/cros/cros_library.h" | 28 #include "chrome/browser/chromeos/cros/cros_library.h" |
29 #include "chrome/browser/chromeos/cros/libcros_service_library.h" | 29 #include "chrome/browser/chromeos/cros/libcros_service_library.h" |
30 #include "chrome/browser/chromeos/proxy_config_service.h" | |
31 #endif // defined(OS_CHROMEOS) | 30 #endif // defined(OS_CHROMEOS) |
32 | 31 |
33 namespace { | 32 namespace { |
34 | 33 |
35 // ---------------------------------------------------------------------------- | 34 // ---------------------------------------------------------------------------- |
36 // CookieMonster::Delegate implementation | 35 // CookieMonster::Delegate implementation |
37 // ---------------------------------------------------------------------------- | 36 // ---------------------------------------------------------------------------- |
38 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 37 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { |
39 public: | 38 public: |
40 explicit ChromeCookieMonsterDelegate(Profile* profile) { | 39 explicit ChromeCookieMonsterDelegate(Profile* profile) { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 264 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
266 | 265 |
267 // Create a baseline service that provides proxy configuration in case nothing | 266 // Create a baseline service that provides proxy configuration in case nothing |
268 // is configured through prefs (Note: prefs include command line and | 267 // is configured through prefs (Note: prefs include command line and |
269 // configuration policy). | 268 // configuration policy). |
270 net::ProxyConfigService* base_service = NULL; | 269 net::ProxyConfigService* base_service = NULL; |
271 | 270 |
272 // TODO(port): the IO and FILE message loops are only used by Linux. Can | 271 // TODO(port): the IO and FILE message loops are only used by Linux. Can |
273 // that code be moved to chrome/browser instead of being in net, so that it | 272 // that code be moved to chrome/browser instead of being in net, so that it |
274 // can use BrowserThread instead of raw MessageLoop pointers? See bug 25354. | 273 // can use BrowserThread instead of raw MessageLoop pointers? See bug 25354. |
275 #if defined(OS_CHROMEOS) | 274 #if !defined(OS_CHROMEOS) |
276 base_service = new chromeos::ProxyConfigService( | |
277 profile->GetChromeOSProxyConfigServiceImpl()); | |
278 #else | |
279 base_service = net::ProxyService::CreateSystemProxyConfigService( | 275 base_service = net::ProxyService::CreateSystemProxyConfigService( |
280 g_browser_process->io_thread()->message_loop(), | 276 g_browser_process->io_thread()->message_loop(), |
281 g_browser_process->file_thread()->message_loop()); | 277 g_browser_process->file_thread()->message_loop()); |
282 #endif // defined(OS_CHROMEOS) | 278 #endif // defined(OS_CHROMEOS) |
kuan
2011/02/22 22:20:25
chromeos has no base_service? this would mean that
Mattias Nissler (ping if slow)
2011/03/01 15:19:20
It's intentional that ChromeOS now doesn't have ba
| |
283 | 279 |
284 return new PrefProxyConfigService(profile->GetProxyConfigTracker(), | 280 return new PrefProxyConfigService(profile->GetProxyConfigTracker(), |
285 base_service); | 281 base_service); |
286 } | 282 } |
287 | 283 |
288 // static | 284 // static |
289 net::ProxyService* ProfileIOData::CreateProxyService( | 285 net::ProxyService* ProfileIOData::CreateProxyService( |
290 net::NetLog* net_log, | 286 net::NetLog* net_log, |
291 net::URLRequestContext* context, | 287 net::URLRequestContext* context, |
292 net::ProxyConfigService* proxy_config_service, | 288 net::ProxyConfigService* proxy_config_service, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 | 330 |
335 #if defined(OS_CHROMEOS) | 331 #if defined(OS_CHROMEOS) |
336 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { | 332 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { |
337 chromeos::CrosLibrary::Get()->GetLibCrosServiceLibrary()-> | 333 chromeos::CrosLibrary::Get()->GetLibCrosServiceLibrary()-> |
338 RegisterNetworkProxyHandler(proxy_service); | 334 RegisterNetworkProxyHandler(proxy_service); |
339 } | 335 } |
340 #endif // defined(OS_CHROMEOS) | 336 #endif // defined(OS_CHROMEOS) |
341 | 337 |
342 return proxy_service; | 338 return proxy_service; |
343 } | 339 } |
OLD | NEW |