Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 REQUIRE_AUTOCOMPLETE, | 148 REQUIRE_AUTOCOMPLETE, |
| 149 static_cast<ExtractMask>( | 149 static_cast<ExtractMask>( |
| 150 EXTRACT_VALUE | EXTRACT_OPTION_TEXT), | 150 EXTRACT_VALUE | EXTRACT_OPTION_TEXT), |
| 151 &form_data, | 151 &form_data, |
| 152 NULL)) { | 152 NULL)) { |
| 153 Send(new AutofillHostMsg_FormSubmitted(routing_id(), form_data, | 153 Send(new AutofillHostMsg_FormSubmitted(routing_id(), form_data, |
| 154 base::TimeTicks::Now())); | 154 base::TimeTicks::Now())); |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 void AutofillAgent::DidHandleWheelEvent( | |
| 159 const WebKit::WebMouseWheelEvent& event) { | |
| 160 // Any time the page scroll any Autofill popups should be hidden. | |
|
Ilya Sherman
2012/04/24 20:15:29
nit: Perhaps mention why this only needs to happen
csharp
2012/04/24 20:22:39
Done.
| |
| 161 Send(new AutofillHostMsg_HideAutofillPopup(routing_id())); | |
| 162 } | |
| 163 | |
| 158 bool AutofillAgent::InputElementClicked(const WebInputElement& element, | 164 bool AutofillAgent::InputElementClicked(const WebInputElement& element, |
| 159 bool was_focused, | 165 bool was_focused, |
| 160 bool is_focused) { | 166 bool is_focused) { |
| 161 if (was_focused) | 167 if (was_focused) |
| 162 ShowSuggestions(element, true, false, true); | 168 ShowSuggestions(element, true, false, true); |
| 163 | 169 |
| 164 return false; | 170 return false; |
| 165 } | 171 } |
| 166 | 172 |
| 167 bool AutofillAgent::InputElementLostFocus() { | 173 bool AutofillAgent::InputElementLostFocus() { |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 571 | 577 |
| 572 void AutofillAgent::SetNodeText(const string16& value, | 578 void AutofillAgent::SetNodeText(const string16& value, |
| 573 WebKit::WebInputElement* node) { | 579 WebKit::WebInputElement* node) { |
| 574 string16 substring = value; | 580 string16 substring = value; |
| 575 substring = substring.substr(0, node->maxLength()); | 581 substring = substring.substr(0, node->maxLength()); |
| 576 | 582 |
| 577 node->setValue(substring, true); | 583 node->setValue(substring, true); |
| 578 } | 584 } |
| 579 | 585 |
| 580 } // namespace autofill | 586 } // namespace autofill |
| OLD | NEW |