OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/autofill/content/renderer/password_generation_agent.h" | 5 #include "components/autofill/content/renderer/password_generation_agent.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "components/autofill/content/common/autofill_messages.h" | 10 #include "components/autofill/content/common/autofill_messages.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 void PasswordGenerationAgent::DetermineGenerationElement() { | 274 void PasswordGenerationAgent::DetermineGenerationElement() { |
275 // Make sure local heuristics have identified a possible account creation | 275 // Make sure local heuristics have identified a possible account creation |
276 // form. | 276 // form. |
277 if (!possible_account_creation_form_.get() || password_elements_.empty()) { | 277 if (!possible_account_creation_form_.get() || password_elements_.empty()) { |
278 DVLOG(2) << "Local hueristics have not detected a possible account " | 278 DVLOG(2) << "Local hueristics have not detected a possible account " |
279 << "creation form"; | 279 << "creation form"; |
280 return; | 280 return; |
281 } | 281 } |
282 | 282 |
283 if (CommandLine::ForCurrentProcess()->HasSwitch( | 283 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
284 switches::kLocalHeuristicsOnlyForPasswordGeneration)) { | 284 switches::kLocalHeuristicsOnlyForPasswordGeneration)) { |
285 DVLOG(2) << "Bypassing additional checks."; | 285 DVLOG(2) << "Bypassing additional checks."; |
286 } else if (not_blacklisted_password_form_origins_.empty() || | 286 } else if (not_blacklisted_password_form_origins_.empty() || |
287 !ContainsURL(not_blacklisted_password_form_origins_, | 287 !ContainsURL(not_blacklisted_password_form_origins_, |
288 possible_account_creation_form_->origin)) { | 288 possible_account_creation_form_->origin)) { |
289 DVLOG(2) << "Have not received confirmation that password form isn't " | 289 DVLOG(2) << "Have not received confirmation that password form isn't " |
290 << "blacklisted"; | 290 << "blacklisted"; |
291 return; | 291 return; |
292 } else if (generation_enabled_forms_.empty() || | 292 } else if (generation_enabled_forms_.empty() || |
293 !ContainsForm(generation_enabled_forms_, | 293 !ContainsForm(generation_enabled_forms_, |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 *possible_account_creation_form_)); | 403 *possible_account_creation_form_)); |
404 | 404 |
405 editing_popup_shown_ = true; | 405 editing_popup_shown_ = true; |
406 } | 406 } |
407 | 407 |
408 void PasswordGenerationAgent::HidePopup() { | 408 void PasswordGenerationAgent::HidePopup() { |
409 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id())); | 409 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id())); |
410 } | 410 } |
411 | 411 |
412 } // namespace autofill | 412 } // namespace autofill |
OLD | NEW |