| 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 | 4 |
| 5 #include "components/safe_browsing/password_protection/password_protection_reque
st.h" | 5 #include "components/safe_browsing/password_protection/password_protection_reque
st.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "components/data_use_measurement/core/data_use_user_data.h" | 10 #include "components/data_use_measurement/core/data_use_user_data.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // TODO(jialiul): Fill more frame specific info when Safe Browsing backend | 141 // TODO(jialiul): Fill more frame specific info when Safe Browsing backend |
| 142 // is ready to handle these pieces of information. | 142 // is ready to handle these pieces of information. |
| 143 break; | 143 break; |
| 144 } | 144 } |
| 145 case LoginReputationClientRequest::PASSWORD_REUSE_EVENT: { | 145 case LoginReputationClientRequest::PASSWORD_REUSE_EVENT: { |
| 146 main_frame->set_has_password_field(password_field_exists_); | 146 main_frame->set_has_password_field(password_field_exists_); |
| 147 LoginReputationClientRequest::PasswordReuseEvent* reuse_event = | 147 LoginReputationClientRequest::PasswordReuseEvent* reuse_event = |
| 148 request_proto_->mutable_password_reuse_event(); | 148 request_proto_->mutable_password_reuse_event(); |
| 149 reuse_event->set_is_chrome_signin_password( | 149 reuse_event->set_is_chrome_signin_password( |
| 150 saved_domain_ == std::string(password_manager::kSyncPasswordDomain)); | 150 saved_domain_ == std::string(password_manager::kSyncPasswordDomain)); |
| 151 if (reuse_event->is_chrome_signin_password()) { |
| 152 reuse_event->set_sync_account_type( |
| 153 password_protection_service_->GetSyncAccountType()); |
| 154 UMA_HISTOGRAM_ENUMERATION( |
| 155 "PasswordProtection.PasswordReuseSyncAccountType", |
| 156 reuse_event->sync_account_type(), |
| 157 LoginReputationClientRequest::PasswordReuseEvent:: |
| 158 SyncAccountType_MAX + |
| 159 1); |
| 160 } |
| 151 break; | 161 break; |
| 152 } | 162 } |
| 153 default: | 163 default: |
| 154 NOTREACHED(); | 164 NOTREACHED(); |
| 155 } | 165 } |
| 156 } | 166 } |
| 157 | 167 |
| 158 void PasswordProtectionRequest::SendRequest() { | 168 void PasswordProtectionRequest::SendRequest() { |
| 159 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 169 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 160 FillRequestProto(); | 170 FillRequestProto(); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 void PasswordProtectionRequest::Cancel(bool timed_out) { | 308 void PasswordProtectionRequest::Cancel(bool timed_out) { |
| 299 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 309 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 300 fetcher_.reset(); | 310 fetcher_.reset(); |
| 301 | 311 |
| 302 Finish(timed_out ? PasswordProtectionService::TIMEDOUT | 312 Finish(timed_out ? PasswordProtectionService::TIMEDOUT |
| 303 : PasswordProtectionService::CANCELED, | 313 : PasswordProtectionService::CANCELED, |
| 304 nullptr); | 314 nullptr); |
| 305 } | 315 } |
| 306 | 316 |
| 307 } // namespace safe_browsing | 317 } // namespace safe_browsing |
| OLD | NEW |