| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/passwords/manage_passwords_state.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_state.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" | 9 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" |
| 10 #include "components/password_manager/core/browser/log_manager.h" | 10 #include "components/password_manager/core/browser/log_manager.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 current_forms[form_manager_->pending_credentials().username_value] = | 145 current_forms[form_manager_->pending_credentials().username_value] = |
| 146 &form_manager_->pending_credentials(); | 146 &form_manager_->pending_credentials(); |
| 147 current_forms_weak_ = MapToVector(current_forms); | 147 current_forms_weak_ = MapToVector(current_forms); |
| 148 origin_ = form_manager_->pending_credentials().origin; | 148 origin_ = form_manager_->pending_credentials().origin; |
| 149 SetState(password_manager::ui::CONFIRMATION_STATE); | 149 SetState(password_manager::ui::CONFIRMATION_STATE); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void ManagePasswordsState::OnPasswordAutofilled( | 152 void ManagePasswordsState::OnPasswordAutofilled( |
| 153 const PasswordFormMap& password_form_map, | 153 const PasswordFormMap& password_form_map, |
| 154 const GURL& origin) { | 154 const GURL& origin) { |
| 155 // TODO(vabr): Revert back to DCHECK once http://crbug.com/486931 is fixed. | 155 DCHECK(!password_form_map.empty()); |
| 156 CHECK(!password_form_map.empty()); | |
| 157 ClearData(); | 156 ClearData(); |
| 158 if (password_form_map.begin()->second->is_public_suffix_match) { | 157 if (password_form_map.begin()->second->is_public_suffix_match) { |
| 159 // Don't show the UI for PSL matched passwords. They are not stored for this | 158 // Don't show the UI for PSL matched passwords. They are not stored for this |
| 160 // page and cannot be deleted. | 159 // page and cannot be deleted. |
| 161 origin_ = GURL(); | 160 origin_ = GURL(); |
| 162 SetState(password_manager::ui::INACTIVE_STATE); | 161 SetState(password_manager::ui::INACTIVE_STATE); |
| 163 } else { | 162 } else { |
| 164 local_credentials_forms_ = DeepCopyMapToVector(password_form_map); | 163 local_credentials_forms_ = DeepCopyMapToVector(password_form_map); |
| 165 origin_ = origin; | 164 origin_ = origin; |
| 166 SetState(password_manager::ui::MANAGE_STATE); | 165 SetState(password_manager::ui::MANAGE_STATE); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 DCHECK(client_); | 299 DCHECK(client_); |
| 301 if (client_->GetLogManager()->IsLoggingActive()) { | 300 if (client_->GetLogManager()->IsLoggingActive()) { |
| 302 password_manager::BrowserSavePasswordProgressLogger logger( | 301 password_manager::BrowserSavePasswordProgressLogger logger( |
| 303 client_->GetLogManager()); | 302 client_->GetLogManager()); |
| 304 logger.LogNumber( | 303 logger.LogNumber( |
| 305 autofill::SavePasswordProgressLogger::STRING_NEW_UI_STATE, | 304 autofill::SavePasswordProgressLogger::STRING_NEW_UI_STATE, |
| 306 state); | 305 state); |
| 307 } | 306 } |
| 308 state_ = state; | 307 state_ = state; |
| 309 } | 308 } |
| OLD | NEW |