Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: webkit/glue/webview_impl.cc

Issue 159839: A quick fix for Issue 18353.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2007 Google Inc. All Rights Reserved. 2 * Copyright 2007 Google Inc. All Rights Reserved.
3 * 3 *
4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
5 * 5 *
6 * ***** BEGIN LICENSE BLOCK ***** 6 * ***** BEGIN LICENSE BLOCK *****
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 // deletion. 686 // deletion.
687 autocomplete_popup_client_->RemoveItemAtIndex(selected_index); 687 autocomplete_popup_client_->RemoveItemAtIndex(selected_index);
688 RefreshAutofillPopup(); 688 RefreshAutofillPopup();
689 return false; 689 return false;
690 } 690 }
691 691
692 if (!autocomplete_popup_->isInterestedInEventForKey(event.windowsKeyCode)) 692 if (!autocomplete_popup_->isInterestedInEventForKey(event.windowsKeyCode))
693 return false; 693 return false;
694 694
695 if (autocomplete_popup_->handleKeyEvent(MakePlatformKeyboardEvent(event))) { 695 if (autocomplete_popup_->handleKeyEvent(MakePlatformKeyboardEvent(event))) {
696 #if defined(OS_WIN) || defined(OS_LINUX)
697 // We need to ignore the next Char event after this otherwise pressing 696 // We need to ignore the next Char event after this otherwise pressing
698 // enter when selecting an item in the menu will go to the page. 697 // enter when selecting an item in the menu will go to the page.
699 if (WebInputEvent::RawKeyDown == event.type) 698 if (WebInputEvent::RawKeyDown == event.type)
700 suppress_next_keypress_event_ = true; 699 suppress_next_keypress_event_ = true;
701 #endif
702 return true; 700 return true;
703 } 701 }
704 702
705 return false; 703 return false;
706 } 704 }
707 705
708 bool WebViewImpl::CharEvent(const WebKeyboardEvent& event) { 706 bool WebViewImpl::CharEvent(const WebKeyboardEvent& event) {
709 DCHECK(event.type == WebInputEvent::Char); 707 DCHECK(event.type == WebInputEvent::Char);
710 708
711 // Please refer to the comments explaining the suppress_next_keypress_event_ 709 // Please refer to the comments explaining the suppress_next_keypress_event_
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 switch (event.type) { 827 switch (event.type) {
830 case WebInputEvent::Char: { 828 case WebInputEvent::Char: {
831 if (event.windowsKeyCode == VKEY_SPACE) { 829 if (event.windowsKeyCode == VKEY_SPACE) {
832 int key_code = ((event.modifiers & WebInputEvent::ShiftKey) ? 830 int key_code = ((event.modifiers & WebInputEvent::ShiftKey) ?
833 VKEY_PRIOR : VKEY_NEXT); 831 VKEY_PRIOR : VKEY_NEXT);
834 return ScrollViewWithKeyboard(key_code); 832 return ScrollViewWithKeyboard(key_code);
835 } 833 }
836 break; 834 break;
837 } 835 }
838 836
839 #if defined(OS_WIN) || defined(OS_LINUX)
840 case WebInputEvent::RawKeyDown: { 837 case WebInputEvent::RawKeyDown: {
841 #else
842 case WebInputEvent::KeyDown: {
843 #endif
844 if (event.modifiers == WebInputEvent::ControlKey) { 838 if (event.modifiers == WebInputEvent::ControlKey) {
845 switch (event.windowsKeyCode) { 839 switch (event.windowsKeyCode) {
846 case 'A': 840 case 'A':
847 GetFocusedFrame()->SelectAll(); 841 GetFocusedFrame()->SelectAll();
848 return true; 842 return true;
849 case VKEY_INSERT: 843 case VKEY_INSERT:
850 case 'C': 844 case 'C':
851 GetFocusedFrame()->Copy(); 845 GetFocusedFrame()->Copy();
852 return true; 846 return true;
853 // Match FF behavior in the sense that Ctrl+home/end are the only Ctrl 847 // Match FF behavior in the sense that Ctrl+home/end are the only Ctrl
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 1960
1967 return document->focusedNode(); 1961 return document->focusedNode();
1968 } 1962 }
1969 1963
1970 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { 1964 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) {
1971 IntPoint doc_point( 1965 IntPoint doc_point(
1972 page_->mainFrame()->view()->windowToContents(pos)); 1966 page_->mainFrame()->view()->windowToContents(pos));
1973 return page_->mainFrame()->eventHandler()-> 1967 return page_->mainFrame()->eventHandler()->
1974 hitTestResultAtPoint(doc_point, false); 1968 hitTestResultAtPoint(doc_point, false);
1975 } 1969 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698