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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 // End of code block subject to Apple, Inc. copyright | 629 // End of code block subject to Apple, Inc. copyright |
630 // | 630 // |
631 | 631 |
632 void EditorClientImpl::handleKeyboardEvent(WebCore::KeyboardEvent* evt) { | 632 void EditorClientImpl::handleKeyboardEvent(WebCore::KeyboardEvent* evt) { |
633 if (evt->keyCode() == WebCore::VKEY_DOWN || | 633 if (evt->keyCode() == WebCore::VKEY_DOWN || |
634 evt->keyCode() == WebCore::VKEY_UP) { | 634 evt->keyCode() == WebCore::VKEY_UP) { |
635 DCHECK(evt->target()->toNode()); | 635 DCHECK(evt->target()->toNode()); |
636 ShowFormAutofillForNode(evt->target()->toNode()); | 636 ShowFormAutofillForNode(evt->target()->toNode()); |
637 } | 637 } |
638 | 638 |
639 if (handleEditingKeyboardEvent(evt)) | 639 // Calls WebViewDelegate's HandleCurrentKeyboardEvent() first to give it a |
| 640 // chance to handle the keyboard event. Bypass handleEditingKeyboardEvent(), |
| 641 // if WebViewDelegate handles the event. |
| 642 WebViewDelegate* d = web_view_->delegate(); |
| 643 if ((d && d->HandleCurrentKeyboardEvent()) || handleEditingKeyboardEvent(evt)) |
640 evt->setDefaultHandled(); | 644 evt->setDefaultHandled(); |
641 } | 645 } |
642 | 646 |
643 void EditorClientImpl::handleInputMethodKeydown(WebCore::KeyboardEvent* keyEvent
) { | 647 void EditorClientImpl::handleInputMethodKeydown(WebCore::KeyboardEvent* keyEvent
) { |
644 // We handle IME within chrome. | 648 // We handle IME within chrome. |
645 } | 649 } |
646 | 650 |
647 void EditorClientImpl::textFieldDidBeginEditing(WebCore::Element*) { | 651 void EditorClientImpl::textFieldDidBeginEditing(WebCore::Element*) { |
648 } | 652 } |
649 | 653 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 | 905 |
902 void EditorClientImpl::getGuessesForWord(const WebCore::String&, | 906 void EditorClientImpl::getGuessesForWord(const WebCore::String&, |
903 WTF::Vector<WebCore::String>& guesses)
{ | 907 WTF::Vector<WebCore::String>& guesses)
{ |
904 NOTIMPLEMENTED(); | 908 NOTIMPLEMENTED(); |
905 } | 909 } |
906 | 910 |
907 void EditorClientImpl::setInputMethodState(bool enabled) { | 911 void EditorClientImpl::setInputMethodState(bool enabled) { |
908 if (editing_client_) | 912 if (editing_client_) |
909 editing_client_->setInputMethodEnabled(enabled); | 913 editing_client_->setInputMethodEnabled(enabled); |
910 } | 914 } |
OLD | NEW |