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

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

Issue 2650403006: Remove PlatformMouseEvent and use WebMouseEvent instead (Closed)
Patch Set: Fix nits Created 3 years, 10 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 // 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
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?
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/PageWidgetDelegate.cpp ('k') | third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698