| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/autofill/autofill_agent.h" | 5 #include "chrome/renderer/autofill/autofill_agent.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 bool AutofillAgent::InputElementClicked(const WebInputElement& element, | 120 bool AutofillAgent::InputElementClicked(const WebInputElement& element, |
| 121 bool was_focused, | 121 bool was_focused, |
| 122 bool is_focused) { | 122 bool is_focused) { |
| 123 if (was_focused) | 123 if (was_focused) |
| 124 ShowSuggestions(element, true, false, true); | 124 ShowSuggestions(element, true, false, true); |
| 125 | 125 |
| 126 return false; | 126 return false; |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool AutofillAgent::InputElementLostFocus() { |
| 130 return false; |
| 131 } |
| 132 |
| 129 void AutofillAgent::didAcceptAutofillSuggestion(const WebNode& node, | 133 void AutofillAgent::didAcceptAutofillSuggestion(const WebNode& node, |
| 130 const WebString& value, | 134 const WebString& value, |
| 131 const WebString& label, | 135 const WebString& label, |
| 132 int unique_id, | 136 int unique_id, |
| 133 unsigned index) { | 137 unsigned index) { |
| 134 if (password_autofill_manager_->DidAcceptAutofillSuggestion(node, value)) | 138 if (password_autofill_manager_->DidAcceptAutofillSuggestion(node, value)) |
| 135 return; | 139 return; |
| 136 | 140 |
| 137 if (suggestions_options_index_ != -1 && | 141 if (suggestions_options_index_ != -1 && |
| 138 index == static_cast<unsigned>(suggestions_options_index_)) { | 142 index == static_cast<unsigned>(suggestions_options_index_)) { |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 return; | 428 return; |
| 425 } | 429 } |
| 426 | 430 |
| 427 autofill_action_ = action; | 431 autofill_action_ = action; |
| 428 was_query_node_autofilled_ = field.is_autofilled; | 432 was_query_node_autofilled_ = field.is_autofilled; |
| 429 Send(new AutofillHostMsg_FillAutofillFormData( | 433 Send(new AutofillHostMsg_FillAutofillFormData( |
| 430 routing_id(), autofill_query_id_, form, field, unique_id)); | 434 routing_id(), autofill_query_id_, form, field, unique_id)); |
| 431 } | 435 } |
| 432 | 436 |
| 433 } // namespace autofill | 437 } // namespace autofill |
| OLD | NEW |