| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "components/safe_browsing/password_protection/password_protection_reque
st.h" | 4 #include "components/safe_browsing/password_protection/password_protection_reque
st.h" |
| 5 | 5 |
| 6 #include "base/memory/ptr_util.h" | 6 #include "base/memory/ptr_util.h" |
| 7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "components/data_use_measurement/core/data_use_user_data.h" | 9 #include "components/data_use_measurement/core/data_use_user_data.h" |
| 10 #include "components/safe_browsing_db/database_manager.h" | 10 #include "components/safe_browsing_db/database_manager.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 password_frame->set_has_password_field(true); | 116 password_frame->set_has_password_field(true); |
| 117 // TODO(jialiul): Add referrer chain for subframes later. | 117 // TODO(jialiul): Add referrer chain for subframes later. |
| 118 password_form = password_frame->add_forms(); | 118 password_form = password_frame->add_forms(); |
| 119 } | 119 } |
| 120 password_form->set_action_url(password_form_action_.spec()); | 120 password_form->set_action_url(password_form_action_.spec()); |
| 121 // TODO(jialiul): Fill more frame specific info when Safe Browsing backend | 121 // TODO(jialiul): Fill more frame specific info when Safe Browsing backend |
| 122 // is ready to handle these pieces of information. | 122 // is ready to handle these pieces of information. |
| 123 break; | 123 break; |
| 124 } | 124 } |
| 125 case LoginReputationClientRequest::PASSWORD_REUSE_EVENT: { | 125 case LoginReputationClientRequest::PASSWORD_REUSE_EVENT: { |
| 126 if (password_protection_service_->IsExtendedReporting() && | 126 // TODO(jialiul): Fill more password reuse related information when ready. |
| 127 !password_protection_service_->IsIncognito()) { | |
| 128 LoginReputationClientRequest::PasswordReuseEvent* password_reuse = | |
| 129 request_proto_->mutable_password_reuse_event(); | |
| 130 password_reuse->add_password_reused_original_origins(saved_domain_); | |
| 131 } | |
| 132 // TODO(jialiul): Fill more password_reuse information. | |
| 133 break; | 127 break; |
| 134 } | 128 } |
| 135 default: | 129 default: |
| 136 NOTREACHED(); | 130 NOTREACHED(); |
| 137 } | 131 } |
| 138 } | 132 } |
| 139 | 133 |
| 140 void PasswordProtectionRequest::SendRequest() { | 134 void PasswordProtectionRequest::SendRequest() { |
| 141 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 135 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 142 FillRequestProto(); | 136 FillRequestProto(); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void PasswordProtectionRequest::Cancel(bool timed_out) { | 241 void PasswordProtectionRequest::Cancel(bool timed_out) { |
| 248 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 242 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 249 fetcher_.reset(); | 243 fetcher_.reset(); |
| 250 | 244 |
| 251 Finish(timed_out ? PasswordProtectionService::TIMEDOUT | 245 Finish(timed_out ? PasswordProtectionService::TIMEDOUT |
| 252 : PasswordProtectionService::CANCELED, | 246 : PasswordProtectionService::CANCELED, |
| 253 nullptr); | 247 nullptr); |
| 254 } | 248 } |
| 255 | 249 |
| 256 } // namespace safe_browsing | 250 } // namespace safe_browsing |
| OLD | NEW |