| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/password_autocomplete_manager.h" | 5 #include "chrome/renderer/password_autocomplete_manager.h" |
| 6 | 6 |
| 7 #include "base/keyboard_codes.h" | 7 #include "app/keyboard_codes.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| 11 #include "chrome/renderer/render_view.h" | 11 #include "chrome/renderer/render_view.h" |
| 12 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" |
| 13 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" | 13 #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" |
| 14 #include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h" | 14 #include "third_party/WebKit/WebKit/chromium/public/WebFormElement.h" |
| 15 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 15 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 16 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | 16 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" |
| 17 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 void PasswordAutocompleteManager::TextFieldHandlingKeyDown( | 295 void PasswordAutocompleteManager::TextFieldHandlingKeyDown( |
| 296 const WebKit::WebInputElement& element, | 296 const WebKit::WebInputElement& element, |
| 297 const WebKit::WebKeyboardEvent& event) { | 297 const WebKit::WebKeyboardEvent& event) { |
| 298 | 298 |
| 299 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(element); | 299 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(element); |
| 300 if (iter == login_to_password_info_.end()) | 300 if (iter == login_to_password_info_.end()) |
| 301 return; | 301 return; |
| 302 | 302 |
| 303 int win_key_code = event.windowsKeyCode; | 303 int win_key_code = event.windowsKeyCode; |
| 304 iter->second.backspace_pressed_last = | 304 iter->second.backspace_pressed_last = |
| 305 (win_key_code == base::VKEY_BACK || win_key_code == base::VKEY_DELETE); | 305 (win_key_code == app::VKEY_BACK || win_key_code == app::VKEY_DELETE); |
| 306 } | 306 } |
| 307 | 307 |
| 308 bool PasswordAutocompleteManager::InputElementClicked( | 308 bool PasswordAutocompleteManager::InputElementClicked( |
| 309 const WebKit::WebInputElement& element, bool already_focused) { | 309 const WebKit::WebInputElement& element, bool already_focused) { |
| 310 return false; | 310 return false; |
| 311 } | 311 } |
| 312 | 312 |
| 313 bool PasswordAutocompleteManager::FillPassword( | 313 bool PasswordAutocompleteManager::FillPassword( |
| 314 const WebKit::WebInputElement& user_input) { | 314 const WebKit::WebInputElement& user_input) { |
| 315 LoginToPasswordInfoMap::iterator iter = | 315 LoginToPasswordInfoMap::iterator iter = |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 SetElementAutofilled(username_element, true); | 457 SetElementAutofilled(username_element, true); |
| 458 if (IsElementEditable(*password_element)) | 458 if (IsElementEditable(*password_element)) |
| 459 password_element->setValue(password); | 459 password_element->setValue(password); |
| 460 SetElementAutofilled(password_element, true); | 460 SetElementAutofilled(password_element, true); |
| 461 return true; | 461 return true; |
| 462 } | 462 } |
| 463 | 463 |
| 464 int PasswordAutocompleteManager::GetRoutingID() const { | 464 int PasswordAutocompleteManager::GetRoutingID() const { |
| 465 return render_view_->routing_id(); | 465 return render_view_->routing_id(); |
| 466 } | 466 } |
| OLD | NEW |