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

Side by Side Diff: third_party/WebKit/WebCore/platform/chromium/PopupMenuChromium.h

Issue 18466: Make the selection loop with arrow keys in the autocomplete popup (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // new item is selected (by using the arrow keys). Default is true. 88 // new item is selected (by using the arrow keys). Default is true.
89 void setTextOnIndexChange(bool value); 89 void setTextOnIndexChange(bool value);
90 90
91 // Sets whether the selection should be accepted when the popup menu is 91 // Sets whether the selection should be accepted when the popup menu is
92 // closed (through ESC being pressed or the focus going away). 92 // closed (through ESC being pressed or the focus going away).
93 // Default is true. 93 // Default is true.
94 // Note that when TAB is pressed, the selection is always accepted 94 // Note that when TAB is pressed, the selection is always accepted
95 // regardless of this setting. 95 // regardless of this setting.
96 void setAcceptOnAbandon(bool value); 96 void setAcceptOnAbandon(bool value);
97 97
98 // Sets whether the we should move the selection to the first/last item
99 // when the user presses down/up arrow keys and the last/first item is
100 // selected.
101 // Default is false, causing the first/last item to stay selected.
102 void setLoopSelectionNavigation(bool value);
103
98 PopupListBox* listBox() const { return m_listBox.get(); } 104 PopupListBox* listBox() const { return m_listBox.get(); }
99 105
100 // Refresh the popup values from the PopupMenuClient. 106 // Refresh the popup values from the PopupMenuClient.
101 void refresh(); 107 void refresh();
102 108
103 private: 109 private:
104 friend class WTF::RefCounted<PopupContainer>; 110 friend class WTF::RefCounted<PopupContainer>;
105 111
106 PopupContainer(PopupMenuClient*, bool focusOnShow); 112 PopupContainer(PopupMenuClient*, bool focusOnShow);
107 ~PopupContainer(); 113 ~PopupContainer();
108 114
109 // Paint the border. 115 // Paint the border.
110 void paintBorder(GraphicsContext*, const IntRect&); 116 void paintBorder(GraphicsContext*, const IntRect&);
111 117
112 RefPtr<PopupListBox> m_listBox; 118 RefPtr<PopupListBox> m_listBox;
113 119
114 // Whether the window showing this popup should be focused when shown. 120 // Whether the window showing this popup should be focused when shown.
115 bool m_focusOnShow; 121 bool m_focusOnShow;
116 }; 122 };
117 123
118 } // namespace WebCore 124 } // namespace WebCore
119 125
120 #endif 126 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698