| 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/safe_browsing/client_side_detection_host.h" | 5 #include "chrome/browser/safe_browsing/client_side_detection_host.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 if (csd_service_->IsPrivateIPAddress(params_.socket_address.host())) { | 103 if (csd_service_->IsPrivateIPAddress(params_.socket_address.host())) { |
| 104 VLOG(1) << "Skipping phishing classification for URL: " << params_.url | 104 VLOG(1) << "Skipping phishing classification for URL: " << params_.url |
| 105 << " because of hosting on private IP: " | 105 << " because of hosting on private IP: " |
| 106 << params_.socket_address.host(); | 106 << params_.socket_address.host(); |
| 107 DontClassifyForPhishing(NO_CLASSIFY_PRIVATE_IP); | 107 DontClassifyForPhishing(NO_CLASSIFY_PRIVATE_IP); |
| 108 DontClassifyForMalware(NO_CLASSIFY_PRIVATE_IP); | 108 DontClassifyForMalware(NO_CLASSIFY_PRIVATE_IP); |
| 109 } | 109 } |
| 110 | 110 |
| 111 // For phishing we only classify HTTP pages. | 111 // For phishing we only classify HTTP pages. |
| 112 if (!params_.url.SchemeIs(content::kHttpScheme)) { | 112 if (!params_.url.SchemeIs(url::kHttpScheme)) { |
| 113 VLOG(1) << "Skipping phishing classification for URL: " << params_.url | 113 VLOG(1) << "Skipping phishing classification for URL: " << params_.url |
| 114 << " because it is not HTTP: " | 114 << " because it is not HTTP: " |
| 115 << params_.socket_address.host(); | 115 << params_.socket_address.host(); |
| 116 DontClassifyForPhishing(NO_CLASSIFY_NOT_HTTP_URL); | 116 DontClassifyForPhishing(NO_CLASSIFY_NOT_HTTP_URL); |
| 117 } | 117 } |
| 118 | 118 |
| 119 // Don't run any classifier if the tab is incognito. | 119 // Don't run any classifier if the tab is incognito. |
| 120 if (web_contents_->GetBrowserContext()->IsOffTheRecord()) { | 120 if (web_contents_->GetBrowserContext()->IsOffTheRecord()) { |
| 121 VLOG(1) << "Skipping phishing and malware classification for URL: " | 121 VLOG(1) << "Skipping phishing and malware classification for URL: " |
| 122 << params_.url << " because we're browsing incognito."; | 122 << params_.url << " because we're browsing incognito."; |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 ui_manager_->RemoveObserver(this); | 738 ui_manager_->RemoveObserver(this); |
| 739 | 739 |
| 740 ui_manager_ = ui_manager; | 740 ui_manager_ = ui_manager; |
| 741 if (ui_manager) | 741 if (ui_manager) |
| 742 ui_manager_->AddObserver(this); | 742 ui_manager_->AddObserver(this); |
| 743 | 743 |
| 744 database_manager_ = database_manager; | 744 database_manager_ = database_manager; |
| 745 } | 745 } |
| 746 | 746 |
| 747 } // namespace safe_browsing | 747 } // namespace safe_browsing |
| OLD | NEW |