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

Unified Diff: ui/views/widget/desktop_aura/desktop_drop_target_win.cc

Issue 878413003: Support buttons attribute for drag event (chromium side). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_drop_target_win.cc
diff --git a/ui/views/widget/desktop_aura/desktop_drop_target_win.cc b/ui/views/widget/desktop_aura/desktop_drop_target_win.cc
index f10fc1fc34b3b4e2573478c1710c62cb0ae84f91..6931bd5186338255f1c7d5476861b79c7a822f4f 100644
--- a/ui/views/widget/desktop_aura/desktop_drop_target_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_drop_target_win.cc
@@ -20,6 +20,30 @@ using aura::client::DragDropDelegate;
using ui::OSExchangeData;
using ui::OSExchangeDataProviderWin;
+namespace {
+
+int ConvertKeyStateToAuraEventFlags(DWORD key_state)
+{
+ int flags = 0;
+
+ if (key_state & MK_CONTROL)
+ flags |= ui::EF_CONTROL_DOWN;
+ if (key_state & MK_ALT)
+ flags |= ui::EF_ALT_DOWN;
+ if (key_state & MK_SHIFT)
+ flags |= ui::EF_SHIFT_DOWN;
+ if (key_state & MK_LBUTTON)
+ flags |= ui::EF_LEFT_MOUSE_BUTTON;
+ if (key_state & MK_MBUTTON)
+ flags |= ui::EF_MIDDLE_MOUSE_BUTTON;
+ if (key_state & MK_RBUTTON)
+ flags |= ui::EF_RIGHT_MOUSE_BUTTON;
+
+ return flags;
+}
+
+} // namespace
+
namespace views {
DesktopDropTargetWin::DesktopDropTargetWin(aura::Window* root_window,
@@ -132,11 +156,7 @@ void DesktopDropTargetWin::Translate(
location,
root_location,
ui::DragDropTypes::DropEffectToDragOperation(effect)));
- int flags = 0;
- flags |= base::win::IsAltPressed() ? ui::EF_ALT_DOWN : ui::EF_NONE;
- flags |= base::win::IsShiftPressed() ? ui::EF_SHIFT_DOWN : ui::EF_NONE;
- flags |= base::win::IsCtrlPressed() ? ui::EF_CONTROL_DOWN : ui::EF_NONE;
- (*event)->set_flags(flags);
+ (*event)->set_flags(ConvertKeyStateToAuraEventFlags(key_state));
if (target_window_changed)
(*delegate)->OnDragEntered(*event->get());
}
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698