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

Side by Side Diff: chrome/browser/automation/url_request_automation_job.cc

Issue 12569007: Remove URL fragment from referrer HTTP header when opening link using "Open Link in New Tab" option. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync up to rev 193385 Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/automation/url_request_automation_job.h" 5 #include "chrome/browser/automation/url_request_automation_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 net::HttpRequestHeaders::kAcceptLanguage) && 465 net::HttpRequestHeaders::kAcceptLanguage) &&
466 http_user_agent_settings_) { 466 http_user_agent_settings_) {
467 std::string accept_language = 467 std::string accept_language =
468 http_user_agent_settings_->GetAcceptLanguage(); 468 http_user_agent_settings_->GetAcceptLanguage();
469 if (!accept_language.empty()) { 469 if (!accept_language.empty()) {
470 new_request_headers.SetHeader(net::HttpRequestHeaders::kAcceptLanguage, 470 new_request_headers.SetHeader(net::HttpRequestHeaders::kAcceptLanguage,
471 accept_language); 471 accept_language);
472 } 472 }
473 } 473 }
474 474
475 // Ensure that we do not send username and password fields in the referrer. 475 // URLRequest::SetReferrer() ensures that we do not send username and
476 GURL referrer(request_->GetSanitizedReferrer()); 476 // password fields in the referrer.
477 GURL referrer(request_->referrer());
477 478
478 // The referrer header must be suppressed if the preceding URL was 479 // The referrer header must be suppressed if the preceding URL was
479 // a secure one and the new one is not. 480 // a secure one and the new one is not.
480 if (referrer.SchemeIsSecure() && !request_->url().SchemeIsSecure()) { 481 if (referrer.SchemeIsSecure() && !request_->url().SchemeIsSecure()) {
481 DVLOG(1) << "Suppressing referrer header since going from secure to " 482 DVLOG(1) << "Suppressing referrer header since going from secure to "
482 "non-secure"; 483 "non-secure";
483 referrer = GURL(); 484 referrer = GURL();
484 } 485 }
485 486
486 // Get the resource type (main_frame/script/image/stylesheet etc. 487 // Get the resource type (main_frame/script/image/stylesheet etc.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 if (!is_done()) { 532 if (!is_done()) {
532 NotifyDone(request_status_); 533 NotifyDone(request_status_);
533 } 534 }
534 // Reset any pending reads. 535 // Reset any pending reads.
535 if (pending_buf_) { 536 if (pending_buf_) {
536 pending_buf_ = NULL; 537 pending_buf_ = NULL;
537 pending_buf_size_ = 0; 538 pending_buf_size_ = 0;
538 NotifyReadComplete(0); 539 NotifyReadComplete(0);
539 } 540 }
540 } 541 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698