Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "web/PopupMenuImpl.h" | 5 #include "web/PopupMenuImpl.h" |
| 6 | 6 |
| 7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/css/CSSFontSelector.h" | 8 #include "core/css/CSSFontSelector.h" |
| 9 #include "core/dom/ElementTraversal.h" | 9 #include "core/dom/ElementTraversal.h" |
| 10 #include "core/dom/ExecutionContextTask.h" | 10 #include "core/dom/ExecutionContextTask.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 // 'change' event is dispatched here. For compatbility with | 439 // 'change' event is dispatched here. For compatbility with |
| 440 // Angular 1.2, we need to dispatch a change event before | 440 // Angular 1.2, we need to dispatch a change event before |
| 441 // mouseup/click events. | 441 // mouseup/click events. |
| 442 } else { | 442 } else { |
| 443 if (m_popup) | 443 if (m_popup) |
| 444 m_chromeClient->closePagePopup(m_popup); | 444 m_chromeClient->closePagePopup(m_popup); |
| 445 } | 445 } |
| 446 // We dispatch events on the owner element to match the legacy behavior. | 446 // We dispatch events on the owner element to match the legacy behavior. |
| 447 // Other browsers dispatch click events before and after showing the popup. | 447 // Other browsers dispatch click events before and after showing the popup. |
| 448 if (m_ownerElement) { | 448 if (m_ownerElement) { |
| 449 PlatformMouseEvent event; | 449 // TODO(dtapuska): Why is this event positionless? |
|
bokan
2017/01/27 16:57:17
It looks like this is called from popup HTML conte
dtapuska
2017/01/27 21:00:00
This should probably be generated from the element
bokan
2017/01/27 21:08:47
Hmm, yeah, that makes sense.
| |
| 450 WebMouseEvent event; | |
| 451 event.setFrameScale(1); | |
| 450 Element* owner = &ownerElement(); | 452 Element* owner = &ownerElement(); |
| 451 owner->dispatchMouseEvent(event, EventTypeNames::mouseup); | 453 owner->dispatchMouseEvent(event, EventTypeNames::mouseup); |
| 452 owner->dispatchMouseEvent(event, EventTypeNames::click); | 454 owner->dispatchMouseEvent(event, EventTypeNames::click); |
| 453 } | 455 } |
| 454 } | 456 } |
| 455 | 457 |
| 456 void PopupMenuImpl::setValue(const String& value) { | 458 void PopupMenuImpl::setValue(const String& value) { |
| 457 DCHECK(m_ownerElement); | 459 DCHECK(m_ownerElement); |
| 458 bool success; | 460 bool success; |
| 459 int listIndex = value.toInt(&success); | 461 int listIndex = value.toInt(&success); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 554 } | 556 } |
| 555 | 557 |
| 556 void PopupMenuImpl::disconnectClient() { | 558 void PopupMenuImpl::disconnectClient() { |
| 557 m_ownerElement = nullptr; | 559 m_ownerElement = nullptr; |
| 558 // Cannot be done during finalization, so instead done when the | 560 // Cannot be done during finalization, so instead done when the |
| 559 // layout object is destroyed and disconnected. | 561 // layout object is destroyed and disconnected. |
| 560 dispose(); | 562 dispose(); |
| 561 } | 563 } |
| 562 | 564 |
| 563 } // namespace blink | 565 } // namespace blink |
| OLD | NEW |