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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 8806011: Make NavigationEntry and friends use content::Referrer instead of plain URLs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years 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) 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/safe_browsing/safe_browsing_service.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 this, resources, false)); 1049 this, resources, false));
1050 return; 1050 return;
1051 } 1051 }
1052 1052
1053 if (resource.threat_type != SafeBrowsingService::SAFE && 1053 if (resource.threat_type != SafeBrowsingService::SAFE &&
1054 CanReportStats()) { 1054 CanReportStats()) {
1055 GURL page_url = tab_contents->GetURL(); 1055 GURL page_url = tab_contents->GetURL();
1056 GURL referrer_url; 1056 GURL referrer_url;
1057 NavigationEntry* entry = tab_contents->controller().GetActiveEntry(); 1057 NavigationEntry* entry = tab_contents->controller().GetActiveEntry();
1058 if (entry) 1058 if (entry)
1059 referrer_url = entry->referrer(); 1059 referrer_url = entry->referrer().url;
1060 1060
1061 // When the malicious url is on the main frame, and resource.original_url 1061 // When the malicious url is on the main frame, and resource.original_url
1062 // is not the same as the resource.url, that means we have a redirect from 1062 // is not the same as the resource.url, that means we have a redirect from
1063 // resource.original_url to resource.url. 1063 // resource.original_url to resource.url.
1064 // Also, at this point, page_url points to the _previous_ page that we 1064 // Also, at this point, page_url points to the _previous_ page that we
1065 // were on. We replace page_url with resource.original_url and referrer 1065 // were on. We replace page_url with resource.original_url and referrer
1066 // with page_url. 1066 // with page_url.
1067 if (!resource.is_subresource && 1067 if (!resource.is_subresource &&
1068 !resource.original_url.is_empty() && 1068 !resource.original_url.is_empty() &&
1069 resource.original_url != resource.url) { 1069 resource.original_url != resource.url) {
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 Stop(); 1352 Stop();
1353 1353
1354 if (csd_service_.get()) 1354 if (csd_service_.get())
1355 csd_service_->SetEnabledAndRefreshState(enable); 1355 csd_service_->SetEnabledAndRefreshState(enable);
1356 if (download_service_.get()) { 1356 if (download_service_.get()) {
1357 download_service_->SetEnabled( 1357 download_service_->SetEnabled(
1358 enable && !CommandLine::ForCurrentProcess()->HasSwitch( 1358 enable && !CommandLine::ForCurrentProcess()->HasSwitch(
1359 switches::kDisableImprovedDownloadProtection)); 1359 switches::kDisableImprovedDownloadProtection));
1360 } 1360 }
1361 } 1361 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/malware_details.cc ('k') | chrome/browser/sessions/base_session_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698