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

Side by Side Diff: Source/WebCore/platform/chromium/PopupContainer.cpp

Issue 12918021: Merge 145453 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « Source/WebCore/page/EventHandler.cpp ('k') | Source/WebKit/chromium/src/WebFrameImpl.cpp » ('j') | 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 (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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 // Compute the starting x-axis for a normal RTL or right-aligned LTR dropdow n. For those, 265 // Compute the starting x-axis for a normal RTL or right-aligned LTR dropdow n. For those,
266 // the right edge of dropdown box should be aligned with the right edge of < select>/<input> element box, 266 // the right edge of dropdown box should be aligned with the right edge of < select>/<input> element box,
267 // and the dropdown box should be expanded to the left if more space is need ed. 267 // and the dropdown box should be expanded to the left if more space is need ed.
268 // m_originalFrameRect.width() is the width of the target <select>/<input> e lement. 268 // m_originalFrameRect.width() is the width of the target <select>/<input> e lement.
269 return m_originalFrameRect.width() - (m_listBox->width() + kBorderSize * 2); 269 return m_originalFrameRect.width() - (m_listBox->width() + kBorderSize * 2);
270 } 270 }
271 271
272 bool PopupContainer::handleMouseDownEvent(const PlatformMouseEvent& event) 272 bool PopupContainer::handleMouseDownEvent(const PlatformMouseEvent& event)
273 { 273 {
274 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 274 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
275 return m_listBox->handleMouseDownEvent( 275 return m_listBox->handleMouseDownEvent(
276 constructRelativeMouseEvent(event, this, m_listBox.get())); 276 constructRelativeMouseEvent(event, this, m_listBox.get()));
277 } 277 }
278 278
279 bool PopupContainer::handleMouseMoveEvent(const PlatformMouseEvent& event) 279 bool PopupContainer::handleMouseMoveEvent(const PlatformMouseEvent& event)
280 { 280 {
281 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 281 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
282 return m_listBox->handleMouseMoveEvent( 282 return m_listBox->handleMouseMoveEvent(
283 constructRelativeMouseEvent(event, this, m_listBox.get())); 283 constructRelativeMouseEvent(event, this, m_listBox.get()));
284 } 284 }
285 285
286 bool PopupContainer::handleMouseReleaseEvent(const PlatformMouseEvent& event) 286 bool PopupContainer::handleMouseReleaseEvent(const PlatformMouseEvent& event)
287 { 287 {
288 RefPtr<PopupContainer> protect(this); 288 RefPtr<PopupContainer> protect(this);
289 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 289 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
290 return m_listBox->handleMouseReleaseEvent( 290 return m_listBox->handleMouseReleaseEvent(
291 constructRelativeMouseEvent(event, this, m_listBox.get())); 291 constructRelativeMouseEvent(event, this, m_listBox.get()));
292 } 292 }
293 293
294 bool PopupContainer::handleWheelEvent(const PlatformWheelEvent& event) 294 bool PopupContainer::handleWheelEvent(const PlatformWheelEvent& event)
295 { 295 {
296 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 296 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
297 return m_listBox->handleWheelEvent( 297 return m_listBox->handleWheelEvent(
298 constructRelativeWheelEvent(event, this, m_listBox.get())); 298 constructRelativeWheelEvent(event, this, m_listBox.get()));
299 } 299 }
300 300
301 #if ENABLE(TOUCH_EVENTS) 301 #if ENABLE(TOUCH_EVENTS)
302 bool PopupContainer::handleTouchEvent(const PlatformTouchEvent&) 302 bool PopupContainer::handleTouchEvent(const PlatformTouchEvent&)
303 { 303 {
304 return false; 304 return false;
305 } 305 }
306 #endif 306 #endif
(...skipping 26 matching lines...) Expand all
333 break; 333 break;
334 default: 334 default:
335 ASSERT_NOT_REACHED(); 335 ASSERT_NOT_REACHED();
336 } 336 }
337 return false; 337 return false;
338 } 338 }
339 #endif 339 #endif
340 340
341 bool PopupContainer::handleKeyEvent(const PlatformKeyboardEvent& event) 341 bool PopupContainer::handleKeyEvent(const PlatformKeyboardEvent& event)
342 { 342 {
343 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 343 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
344 return m_listBox->handleKeyEvent(event); 344 return m_listBox->handleKeyEvent(event);
345 } 345 }
346 346
347 void PopupContainer::hide() 347 void PopupContainer::hide()
348 { 348 {
349 m_listBox->abandon(); 349 m_listBox->abandon();
350 } 350 }
351 351
352 void PopupContainer::paint(GraphicsContext* gc, const IntRect& rect) 352 void PopupContainer::paint(GraphicsContext* gc, const IntRect& rect)
353 { 353 {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 } 472 }
473 473
474 String PopupContainer::getSelectedItemToolTip() 474 String PopupContainer::getSelectedItemToolTip()
475 { 475 {
476 // We cannot use m_popupClient->selectedIndex() to choose tooltip message, 476 // We cannot use m_popupClient->selectedIndex() to choose tooltip message,
477 // because the selectedIndex() might return final selected index, not hoveri ng selection. 477 // because the selectedIndex() might return final selected index, not hoveri ng selection.
478 return listBox()->m_popupClient->itemToolTip(listBox()->m_selectedIndex); 478 return listBox()->m_popupClient->itemToolTip(listBox()->m_selectedIndex);
479 } 479 }
480 480
481 } // namespace WebCore 481 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/page/EventHandler.cpp ('k') | Source/WebKit/chromium/src/WebFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698