| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 bool AutofillAgent::InputElementClicked(const WebInputElement& element, | 117 bool AutofillAgent::InputElementClicked(const WebInputElement& element, |
| 118 bool was_focused, | 118 bool was_focused, |
| 119 bool is_focused) { | 119 bool is_focused) { |
| 120 if (was_focused) | 120 if (was_focused) |
| 121 ShowSuggestions(element, true, false, true); | 121 ShowSuggestions(element, true, false, true); |
| 122 | 122 |
| 123 return false; | 123 return false; |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool AutofillAgent::InputElementLostFocus() { |
| 127 return false; |
| 128 } |
| 129 |
| 126 void AutofillAgent::didAcceptAutofillSuggestion(const WebNode& node, | 130 void AutofillAgent::didAcceptAutofillSuggestion(const WebNode& node, |
| 127 const WebString& value, | 131 const WebString& value, |
| 128 const WebString& label, | 132 const WebString& label, |
| 129 int unique_id, | 133 int unique_id, |
| 130 unsigned index) { | 134 unsigned index) { |
| 131 if (password_autofill_manager_->DidAcceptAutofillSuggestion(node, value)) | 135 if (password_autofill_manager_->DidAcceptAutofillSuggestion(node, value)) |
| 132 return; | 136 return; |
| 133 | 137 |
| 134 if (suggestions_options_index_ != -1 && | 138 if (suggestions_options_index_ != -1 && |
| 135 index == static_cast<unsigned>(suggestions_options_index_)) { | 139 index == static_cast<unsigned>(suggestions_options_index_)) { |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 return; | 431 return; |
| 428 } | 432 } |
| 429 | 433 |
| 430 autofill_action_ = action; | 434 autofill_action_ = action; |
| 431 was_query_node_autofilled_ = field.is_autofilled; | 435 was_query_node_autofilled_ = field.is_autofilled; |
| 432 Send(new AutofillHostMsg_FillAutofillFormData( | 436 Send(new AutofillHostMsg_FillAutofillFormData( |
| 433 routing_id(), autofill_query_id_, form, field, unique_id)); | 437 routing_id(), autofill_query_id_, form, field, unique_id)); |
| 434 } | 438 } |
| 435 | 439 |
| 436 } // namespace autofill | 440 } // namespace autofill |
| OLD | NEW |