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

Side by Side Diff: Source/web/PopupListBox.cpp

Issue 368023003: Popup open and hide using Alt+KeyDown (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011, Google Inc. All rights reserved. 2 * Copyright (c) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 adjustSelectedIndex(m_items.size()); 236 adjustSelectedIndex(m_items.size());
237 break; 237 break;
238 default: 238 default:
239 if (!event.ctrlKey() && !event.altKey() && !event.metaKey() 239 if (!event.ctrlKey() && !event.altKey() && !event.metaKey()
240 && isPrintableChar(event.windowsVirtualKeyCode()) 240 && isPrintableChar(event.windowsVirtualKeyCode())
241 && isCharacterTypeEvent(event)) 241 && isCharacterTypeEvent(event))
242 typeAheadFind(event); 242 typeAheadFind(event);
243 break; 243 break;
244 } 244 }
245 245
246 if (event.altKey() && event.keyIdentifier() == "Down")
keishi 2014/07/03 07:13:38 We want to support alt+up too.
Habib Virji 2014/07/03 17:24:04 Done.
247 hidePopup();
248
246 if (m_originalIndex != m_selectedIndex) { 249 if (m_originalIndex != m_selectedIndex) {
247 // Keyboard events should update the selection immediately (but we don't 250 // Keyboard events should update the selection immediately (but we don't
248 // want to fire the onchange event until the popup is closed, to match 251 // want to fire the onchange event until the popup is closed, to match
249 // IE). We change the original index so we revert to that when the 252 // IE). We change the original index so we revert to that when the
250 // popup is closed. 253 // popup is closed.
251 m_acceptedIndexOnAbandon = m_selectedIndex; 254 m_acceptedIndexOnAbandon = m_selectedIndex;
252 255
253 setOriginalIndex(m_selectedIndex); 256 setOriginalIndex(m_selectedIndex);
254 m_popupClient->setTextFromItem(m_selectedIndex); 257 m_popupClient->setTextFromItem(m_selectedIndex);
255 } 258 }
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 { 822 {
820 return numItems() && IntRect(0, 0, width(), height()).contains(point); 823 return numItems() && IntRect(0, 0, width(), height()).contains(point);
821 } 824 }
822 825
823 int PopupListBox::popupContentHeight() const 826 int PopupListBox::popupContentHeight() const
824 { 827 {
825 return height(); 828 return height();
826 } 829 }
827 830
828 } // namespace blink 831 } // namespace blink
OLDNEW
« Source/core/html/HTMLSelectElement.cpp ('K') | « Source/core/html/HTMLSelectElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698