| OLD | NEW |
| 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 return listBox()->m_popupClient->itemToolTip(listBox()->m_selectedIndex); | 465 return listBox()->m_popupClient->itemToolTip(listBox()->m_selectedIndex); |
| 466 } | 466 } |
| 467 | 467 |
| 468 void PopupContainer::popupOpened(const IntRect& bounds) | 468 void PopupContainer::popupOpened(const IntRect& bounds) |
| 469 { | 469 { |
| 470 WebViewImpl* webView = WebViewImpl::fromPage(m_frameView->frame().page()); | 470 WebViewImpl* webView = WebViewImpl::fromPage(m_frameView->frame().page()); |
| 471 if (!webView->client()) | 471 if (!webView->client()) |
| 472 return; | 472 return; |
| 473 | 473 |
| 474 WebWidget* webwidget = webView->client()->createPopupMenu(WebPopupTypeSelect
); | 474 WebWidget* webwidget = webView->client()->createPopupMenu(WebPopupTypeSelect
); |
| 475 if (!webwidget) |
| 476 return; |
| 475 // We only notify when the WebView has to handle the popup, as when | 477 // We only notify when the WebView has to handle the popup, as when |
| 476 // the popup is handled externally, the fact that a popup is showing is | 478 // the popup is handled externally, the fact that a popup is showing is |
| 477 // transparent to the WebView. | 479 // transparent to the WebView. |
| 478 webView->popupOpened(this); | 480 webView->popupOpened(this); |
| 479 toWebPopupMenuImpl(webwidget)->initialize(this, bounds); | 481 toWebPopupMenuImpl(webwidget)->initialize(this, bounds); |
| 480 } | 482 } |
| 481 | 483 |
| 482 void PopupContainer::getPopupMenuInfo(WebPopupMenuInfo* info) | 484 void PopupContainer::getPopupMenuInfo(WebPopupMenuInfo* info) |
| 483 { | 485 { |
| 484 const Vector<PopupItem*>& inputItems = popupData(); | 486 const Vector<PopupItem*>& inputItems = popupData(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 511 } | 513 } |
| 512 | 514 |
| 513 info->itemHeight = menuItemHeight(); | 515 info->itemHeight = menuItemHeight(); |
| 514 info->itemFontSize = menuItemFontSize(); | 516 info->itemFontSize = menuItemFontSize(); |
| 515 info->selectedIndex = selectedIndex(); | 517 info->selectedIndex = selectedIndex(); |
| 516 info->items.swap(outputItems); | 518 info->items.swap(outputItems); |
| 517 info->rightAligned = menuStyle().textDirection() == RTL; | 519 info->rightAligned = menuStyle().textDirection() == RTL; |
| 518 } | 520 } |
| 519 | 521 |
| 520 } // namespace blink | 522 } // namespace blink |
| OLD | NEW |