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

Unified Diff: webkit/port/platform/chromium/PopupMenuChromium.cpp

Issue 9621: Improving the form autofill menu behavior (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/port/platform/chromium/PopupMenuChromium.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/platform/chromium/PopupMenuChromium.cpp
===================================================================
--- webkit/port/platform/chromium/PopupMenuChromium.cpp (revision 5031)
+++ webkit/port/platform/chromium/PopupMenuChromium.cpp (working copy)
@@ -130,6 +130,10 @@
// Returns whether the popup wants to process events for the passed key.
bool isInterestedInEventForKey(int key_code);
+ // Sets whether the PopupMenuClient should be told to change its text when a
+ // new item is selected (by using the arrow keys). Default is true.
+ void setTextOnIndexChange(bool value) { m_setTextOnIndexChange = value; }
+
private:
friend class PopupContainer;
friend class RefCounted<PopupListBox>;
@@ -158,6 +162,7 @@
, m_popupClient(client)
, m_repeatingChar(0)
, m_lastCharTime(0)
+ , m_setTextOnIndexChange(true)
{
setScrollbarModes(ScrollbarAlwaysOff, ScrollbarAlwaysOff);
}
@@ -251,6 +256,8 @@
// The last time the user hit a key. Used for typeAheadFind.
TimeStamp m_lastCharTime;
+
+ bool m_setTextOnIndexChange;
};
static PlatformMouseEvent constructRelativeMouseEvent(const PlatformMouseEvent& e,
@@ -464,6 +471,10 @@
showPopup(v);
}
+void PopupContainer::setTextOnIndexChange(bool value) {
+ listBox()->setTextOnIndexChange(value);
+}
+
///////////////////////////////////////////////////////////////////////////////
// PopupListBox implementation
@@ -602,7 +613,8 @@
// popup is closed.
m_acceptOnAbandon = true;
setOriginalIndex(m_selectedIndex);
- m_popupClient->setTextFromItem(m_selectedIndex);
+ if (m_setTextOnIndexChange)
+ m_popupClient->setTextFromItem(m_selectedIndex);
}
return true;
« no previous file with comments | « webkit/port/platform/chromium/PopupMenuChromium.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698