OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // The Mac interface forwards most of these commands to the application layer, | 5 // The Mac interface forwards most of these commands to the application layer, |
6 // and I'm not really sure what to do about most of them. | 6 // and I'm not really sure what to do about most of them. |
7 | 7 |
8 #include "config.h" | 8 #include "config.h" |
9 | 9 |
10 #include "Document.h" | 10 #include "Document.h" |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 // Notification that focus was lost. Be careful with this, it's also sent | 651 // Notification that focus was lost. Be careful with this, it's also sent |
652 // when the page is being closed. | 652 // when the page is being closed. |
653 | 653 |
654 // Cancel any pending DoAutofill call. | 654 // Cancel any pending DoAutofill call. |
655 autofill_args_.clear(); | 655 autofill_args_.clear(); |
656 autofill_timer_.stop(); | 656 autofill_timer_.stop(); |
657 | 657 |
658 // Hide any showing popup. | 658 // Hide any showing popup. |
659 web_view_->HideAutoCompletePopup(); | 659 web_view_->HideAutoCompletePopup(); |
660 | 660 |
| 661 if (!editing_client_) |
| 662 return; // The page is getting closed, don't fill the password. |
| 663 |
661 // Notify any password-listener of the focus change. | 664 // Notify any password-listener of the focus change. |
662 WebCore::HTMLInputElement* input_element = | 665 WebCore::HTMLInputElement* input_element = |
663 webkit_glue::ElementToHTMLInputElement(element); | 666 webkit_glue::ElementToHTMLInputElement(element); |
664 if (!input_element) | 667 if (!input_element) |
665 return; | 668 return; |
666 | 669 |
667 WebFrameImpl* webframe = | 670 WebFrameImpl* webframe = |
668 WebFrameImpl::FromFrame(input_element->document()->frame()); | 671 WebFrameImpl::FromFrame(input_element->document()->frame()); |
669 if (webframe->GetWebViewImpl() && !webframe->GetWebViewImpl()->GetDelegate()) | |
670 return; // The page is getting closed, don't fill the password. | |
671 | |
672 webkit_glue::PasswordAutocompleteListener* listener = | 672 webkit_glue::PasswordAutocompleteListener* listener = |
673 webframe->GetPasswordListener(input_element); | 673 webframe->GetPasswordListener(input_element); |
674 if (!listener) | 674 if (!listener) |
675 return; | 675 return; |
676 | 676 |
677 std::wstring value = | 677 std::wstring value = |
678 webkit_glue::StringToStdWString(input_element->value()); | 678 webkit_glue::StringToStdWString(input_element->value()); |
679 listener->OnBlur(input_element, value); | 679 listener->OnBlur(input_element, value); |
680 } | 680 } |
681 | 681 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 | 901 |
902 void EditorClientImpl::getGuessesForWord(const WebCore::String&, | 902 void EditorClientImpl::getGuessesForWord(const WebCore::String&, |
903 WTF::Vector<WebCore::String>& guesses)
{ | 903 WTF::Vector<WebCore::String>& guesses)
{ |
904 NOTIMPLEMENTED(); | 904 NOTIMPLEMENTED(); |
905 } | 905 } |
906 | 906 |
907 void EditorClientImpl::setInputMethodState(bool enabled) { | 907 void EditorClientImpl::setInputMethodState(bool enabled) { |
908 if (editing_client_) | 908 if (editing_client_) |
909 editing_client_->setInputMethodEnabled(enabled); | 909 editing_client_->setInputMethodEnabled(enabled); |
910 } | 910 } |
OLD | NEW |