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

Side by Side Diff: Source/core/page/DragController.cpp

Issue 879333002: Support buttons attribute for drag event (blink side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 /* 1 /*
2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Google Inc. 3 * Copyright (C) 2008 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 case DragSourceActionNone: 104 case DragSourceActionNone:
105 return false; 105 return false;
106 } 106 }
107 // Make sure MSVC doesn't complain that not all control paths return a value . 107 // Make sure MSVC doesn't complain that not all control paths return a value .
108 return false; 108 return false;
109 } 109 }
110 #endif 110 #endif
111 111
112 static PlatformMouseEvent createMouseEvent(DragData* dragData) 112 static PlatformMouseEvent createMouseEvent(DragData* dragData)
113 { 113 {
114 int keyState = dragData->modifierKeyState();
115 bool shiftKey = static_cast<bool>(keyState & PlatformEvent::ShiftKey);
116 bool ctrlKey = static_cast<bool>(keyState & PlatformEvent::CtrlKey);
117 bool altKey = static_cast<bool>(keyState & PlatformEvent::AltKey);
118 bool metaKey = static_cast<bool>(keyState & PlatformEvent::MetaKey);
119
120 return PlatformMouseEvent(dragData->clientPosition(), dragData->globalPositi on(), 114 return PlatformMouseEvent(dragData->clientPosition(), dragData->globalPositi on(),
121 LeftButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, 115 LeftButton, PlatformEvent::MouseMoved, 0,
122 metaKey, PlatformMouseEvent::RealOrIndistinguishable, currentTime()); 116 static_cast<PlatformEvent::Modifiers>(dragData->modifierKeyState()),
117 PlatformMouseEvent::RealOrIndistinguishable, currentTime());
123 } 118 }
124 119
125 static PassRefPtrWillBeRawPtr<DataTransfer> createDraggingDataTransfer(DataTrans ferAccessPolicy policy, DragData* dragData) 120 static PassRefPtrWillBeRawPtr<DataTransfer> createDraggingDataTransfer(DataTrans ferAccessPolicy policy, DragData* dragData)
126 { 121 {
127 return DataTransfer::create(DataTransfer::DragAndDrop, policy, dragData->pla tformData()); 122 return DataTransfer::create(DataTransfer::DragAndDrop, policy, dragData->pla tformData());
128 } 123 }
129 124
130 DragController::DragController(Page* page, DragClient* client) 125 DragController::DragController(Page* page, DragClient* client)
131 : m_page(page) 126 : m_page(page)
132 , m_client(client) 127 , m_client(client)
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 981
987 void DragController::trace(Visitor* visitor) 982 void DragController::trace(Visitor* visitor)
988 { 983 {
989 visitor->trace(m_page); 984 visitor->trace(m_page);
990 visitor->trace(m_documentUnderMouse); 985 visitor->trace(m_documentUnderMouse);
991 visitor->trace(m_dragInitiator); 986 visitor->trace(m_dragInitiator);
992 visitor->trace(m_fileInputElementUnderMouse); 987 visitor->trace(m_fileInputElementUnderMouse);
993 } 988 }
994 989
995 } // namespace blink 990 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698