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

Side by Side Diff: third_party/WebKit/Source/web/ExternalPopupMenu.cpp

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 didCancel(); 106 didCancel();
107 return false; 107 return false;
108 } 108 }
109 } 109 }
110 110
111 void ExternalPopupMenu::show() { 111 void ExternalPopupMenu::show() {
112 if (!showInternal()) 112 if (!showInternal())
113 return; 113 return;
114 #if OS(MACOSX) 114 #if OS(MACOSX)
115 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent(); 115 const WebInputEvent* currentEvent = WebViewImpl::currentInputEvent();
116 if (currentEvent && currentEvent->type == WebInputEvent::MouseDown) { 116 if (currentEvent && currentEvent->type() == WebInputEvent::MouseDown) {
117 m_syntheticEvent = WTF::wrapUnique(new WebMouseEvent); 117 m_syntheticEvent = WTF::wrapUnique(new WebMouseEvent);
118 *m_syntheticEvent = *static_cast<const WebMouseEvent*>(currentEvent); 118 *m_syntheticEvent = *static_cast<const WebMouseEvent*>(currentEvent);
119 m_syntheticEvent->type = WebInputEvent::MouseUp; 119 m_syntheticEvent->setType(WebInputEvent::MouseUp);
120 m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE); 120 m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE);
121 // FIXME: show() is asynchronous. If preparing a popup is slow and a 121 // FIXME: show() is asynchronous. If preparing a popup is slow and a
122 // user released the mouse button before showing the popup, mouseup and 122 // user released the mouse button before showing the popup, mouseup and
123 // click events are correctly dispatched. Dispatching the synthetic 123 // click events are correctly dispatched. Dispatching the synthetic
124 // mouseup event is redundant in this case. 124 // mouseup event is redundant in this case.
125 } 125 }
126 #endif 126 #endif
127 } 127 }
128 128
129 void ExternalPopupMenu::dispatchEvent(TimerBase*) { 129 void ExternalPopupMenu::dispatchEvent(TimerBase*) {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 if (ownerElement.itemIsDisplayNone(*items[i])) 302 if (ownerElement.itemIsDisplayNone(*items[i]))
303 continue; 303 continue;
304 if (popupMenuItemIndex == i) 304 if (popupMenuItemIndex == i)
305 return indexTracker; 305 return indexTracker;
306 ++indexTracker; 306 ++indexTracker;
307 } 307 }
308 return -1; 308 return -1;
309 } 309 }
310 310
311 } // namespace blink 311 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/DevToolsEmulator.cpp ('k') | third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698