Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/content_settings/cookie_settings.h" | 9 #include "chrome/browser/content_settings/cookie_settings.h" |
| 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 bool ChromeNetworkDelegate::OnCanSetCookie(const net::URLRequest& request, | 296 bool ChromeNetworkDelegate::OnCanSetCookie(const net::URLRequest& request, |
| 297 const std::string& cookie_line, | 297 const std::string& cookie_line, |
| 298 net::CookieOptions* options) { | 298 net::CookieOptions* options) { |
| 299 // NULL during tests, or when we're running in the system context. | 299 // NULL during tests, or when we're running in the system context. |
| 300 if (!cookie_settings_) | 300 if (!cookie_settings_) |
| 301 return true; | 301 return true; |
| 302 | 302 |
| 303 bool allow = cookie_settings_->IsSettingCookieAllowed( | 303 bool allow = cookie_settings_->IsSettingCookieAllowed( |
| 304 request.url(), request.first_party_for_cookies()); | 304 request.url(), request.first_party_for_cookies()); |
| 305 | 305 |
| 306 if (cookie_settings_->IsCookieSessionOnly(request.url())) | |
| 307 options->set_force_session(); | |
|
erikwright (departed)
2012/05/29 13:09:03
It looks like this bit and related logic can go aw
jochen (gone - plz use gerrit)
2012/05/30 11:28:42
Will upload a separate CL
| |
| 308 | |
| 309 int render_process_id = -1; | 306 int render_process_id = -1; |
| 310 int render_view_id = -1; | 307 int render_view_id = -1; |
| 311 if (content::ResourceRequestInfo::GetRenderViewForRequest( | 308 if (content::ResourceRequestInfo::GetRenderViewForRequest( |
| 312 &request, &render_process_id, &render_view_id)) { | 309 &request, &render_process_id, &render_view_id)) { |
| 313 BrowserThread::PostTask( | 310 BrowserThread::PostTask( |
| 314 BrowserThread::UI, FROM_HERE, | 311 BrowserThread::UI, FROM_HERE, |
| 315 base::Bind(&TabSpecificContentSettings::CookieChanged, | 312 base::Bind(&TabSpecificContentSettings::CookieChanged, |
| 316 render_process_id, render_view_id, | 313 render_process_id, render_view_id, |
| 317 request.url(), request.first_party_for_cookies(), | 314 request.url(), request.first_party_for_cookies(), |
| 318 cookie_line, *options, !allow)); | 315 cookie_line, *options, !allow)); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 350 if (white_listed_path == path.StripTrailingSeparators() || | 347 if (white_listed_path == path.StripTrailingSeparators() || |
| 351 white_listed_path.IsParent(path)) { | 348 white_listed_path.IsParent(path)) { |
| 352 return true; | 349 return true; |
| 353 } | 350 } |
| 354 } | 351 } |
| 355 return false; | 352 return false; |
| 356 #else | 353 #else |
| 357 return true; | 354 return true; |
| 358 #endif // defined(OS_CHROMEOS) | 355 #endif // defined(OS_CHROMEOS) |
| 359 } | 356 } |
| OLD | NEW |