| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/net/chrome_url_request_context.h" | 5 #include "chrome/browser/net/chrome_url_request_context.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_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
| 11 #include "chrome/browser/extensions/extensions_service.h" | 11 #include "chrome/browser/extensions/extensions_service.h" |
| 12 #include "chrome/browser/greasemonkey_master.h" | 12 #include "chrome/browser/extensions/user_script_master.h" |
| 13 #include "chrome/browser/profile.h" | 13 #include "chrome/browser/profile.h" |
| 14 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "net/http/http_cache.h" | 17 #include "net/http/http_cache.h" |
| 18 #include "net/proxy/proxy_service.h" | 18 #include "net/proxy/proxy_service.h" |
| 19 #include "webkit/glue/webkit_glue.h" | 19 #include "webkit/glue/webkit_glue.h" |
| 20 | 20 |
| 21 // Sets up proxy info if it was specified, otherwise returns NULL. The | 21 // Sets up proxy info if it was specified, otherwise returns NULL. The |
| 22 // returned pointer MUST be deleted by the caller if non-NULL. | 22 // returned pointer MUST be deleted by the caller if non-NULL. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 cookie_policy_.SetType(net::CookiePolicy::FromInt( | 105 cookie_policy_.SetType(net::CookiePolicy::FromInt( |
| 106 prefs_->GetInteger(prefs::kCookieBehavior))); | 106 prefs_->GetInteger(prefs::kCookieBehavior))); |
| 107 | 107 |
| 108 const ExtensionList* extensions = | 108 const ExtensionList* extensions = |
| 109 profile->GetExtensionsService()->extensions(); | 109 profile->GetExtensionsService()->extensions(); |
| 110 for (ExtensionList::const_iterator iter = extensions->begin(); | 110 for (ExtensionList::const_iterator iter = extensions->begin(); |
| 111 iter != extensions->end(); ++iter) { | 111 iter != extensions->end(); ++iter) { |
| 112 extension_paths_[(*iter)->id()] = (*iter)->path(); | 112 extension_paths_[(*iter)->id()] = (*iter)->path(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 user_script_dir_path_ = profile->GetGreasemonkeyMaster()->user_script_dir(); | 115 user_script_dir_path_ = profile->GetUserScriptMaster()->user_script_dir(); |
| 116 | 116 |
| 117 prefs_->AddPrefObserver(prefs::kAcceptLanguages, this); | 117 prefs_->AddPrefObserver(prefs::kAcceptLanguages, this); |
| 118 prefs_->AddPrefObserver(prefs::kCookieBehavior, this); | 118 prefs_->AddPrefObserver(prefs::kCookieBehavior, this); |
| 119 | 119 |
| 120 NotificationService::current()->AddObserver( | 120 NotificationService::current()->AddObserver( |
| 121 this, NOTIFY_EXTENSIONS_LOADED, NotificationService::AllSources()); | 121 this, NOTIFY_EXTENSIONS_LOADED, NotificationService::AllSources()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 // NotificationObserver implementation. | 124 // NotificationObserver implementation. |
| 125 void ChromeURLRequestContext::Observe(NotificationType type, | 125 void ChromeURLRequestContext::Observe(NotificationType type, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 NotificationService::NoDetails()); | 205 NotificationService::NoDetails()); |
| 206 | 206 |
| 207 delete cookie_store_; | 207 delete cookie_store_; |
| 208 delete http_transaction_factory_; | 208 delete http_transaction_factory_; |
| 209 | 209 |
| 210 // Do not delete the proxy service in the case of OTR, as it is owned by the | 210 // Do not delete the proxy service in the case of OTR, as it is owned by the |
| 211 // original URLRequestContext. | 211 // original URLRequestContext. |
| 212 if (!is_off_the_record_) | 212 if (!is_off_the_record_) |
| 213 delete proxy_service_; | 213 delete proxy_service_; |
| 214 } | 214 } |
| OLD | NEW |