Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
| 2 // All rights reserved. | 2 // 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 504 | 504 |
| 505 bool PopupListBox::handleMouseDownEvent(const PlatformMouseEvent& event) | 505 bool PopupListBox::handleMouseDownEvent(const PlatformMouseEvent& event) |
| 506 { | 506 { |
| 507 Scrollbar* scrollbar = scrollbarUnderMouse(event); | 507 Scrollbar* scrollbar = scrollbarUnderMouse(event); |
| 508 if (scrollbar) { | 508 if (scrollbar) { |
| 509 m_capturingScrollbar = scrollbar; | 509 m_capturingScrollbar = scrollbar; |
| 510 m_capturingScrollbar->mouseDown(event); | 510 m_capturingScrollbar->mouseDown(event); |
| 511 return true; | 511 return true; |
| 512 } | 512 } |
| 513 | 513 |
| 514 // Only process the left button click. | |
| 515 if (event.button() != LeftButton) | |
|
Matt Perry
2008/12/18 22:34:35
Since this is before the "abandon" step, does righ
Evan Stade
2008/12/19 00:19:56
If it's moved to after the abandon() step, it will
| |
| 516 return true; | |
| 517 | |
| 514 if (!isPointInBounds(event.pos())) | 518 if (!isPointInBounds(event.pos())) |
| 515 abandon(); | 519 abandon(); |
| 516 | 520 |
| 517 return true; | 521 return true; |
| 518 } | 522 } |
| 519 | 523 |
| 520 bool PopupListBox::handleMouseMoveEvent(const PlatformMouseEvent& event) | 524 bool PopupListBox::handleMouseMoveEvent(const PlatformMouseEvent& event) |
| 521 { | 525 { |
| 522 if (m_capturingScrollbar) { | 526 if (m_capturingScrollbar) { |
| 523 m_capturingScrollbar->mouseMoved(event); | 527 m_capturingScrollbar->mouseMoved(event); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 545 } | 549 } |
| 546 | 550 |
| 547 bool PopupListBox::handleMouseReleaseEvent(const PlatformMouseEvent& event) | 551 bool PopupListBox::handleMouseReleaseEvent(const PlatformMouseEvent& event) |
| 548 { | 552 { |
| 549 if (m_capturingScrollbar) { | 553 if (m_capturingScrollbar) { |
| 550 m_capturingScrollbar->mouseUp(); | 554 m_capturingScrollbar->mouseUp(); |
| 551 m_capturingScrollbar = 0; | 555 m_capturingScrollbar = 0; |
| 552 return true; | 556 return true; |
| 553 } | 557 } |
| 554 | 558 |
| 559 // Only process the left button click. | |
| 560 if (event.button() != LeftButton) | |
| 561 return true; | |
| 562 | |
| 555 if (!isPointInBounds(event.pos())) | 563 if (!isPointInBounds(event.pos())) |
| 556 return true; | 564 return true; |
| 557 | 565 |
| 558 acceptIndex(pointToRowIndex(event.pos())); | 566 acceptIndex(pointToRowIndex(event.pos())); |
| 559 return true; | 567 return true; |
| 560 } | 568 } |
| 561 | 569 |
| 562 bool PopupListBox::handleWheelEvent(const PlatformWheelEvent& event) | 570 bool PopupListBox::handleWheelEvent(const PlatformWheelEvent& event) |
| 563 { | 571 { |
| 564 if (!isPointInBounds(event.pos())) { | 572 if (!isPointInBounds(event.pos())) { |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1110 { | 1118 { |
| 1111 p.m_popup->listBox()->updateFromElement(); | 1119 p.m_popup->listBox()->updateFromElement(); |
| 1112 } | 1120 } |
| 1113 | 1121 |
| 1114 bool PopupMenu::itemWritingDirectionIsNatural() | 1122 bool PopupMenu::itemWritingDirectionIsNatural() |
| 1115 { | 1123 { |
| 1116 return false; | 1124 return false; |
| 1117 } | 1125 } |
| 1118 | 1126 |
| 1119 } // namespace WebCore | 1127 } // namespace WebCore |
| OLD | NEW |