OLD | NEW |
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 namespace WebCore { | 86 namespace WebCore { |
87 | 87 |
88 const int DragController::DragIconRightInset = 7; | 88 const int DragController::DragIconRightInset = 7; |
89 const int DragController::DragIconBottomInset = 3; | 89 const int DragController::DragIconBottomInset = 3; |
90 | 90 |
91 static const int MaxOriginalImageArea = 1500 * 1500; | 91 static const int MaxOriginalImageArea = 1500 * 1500; |
92 static const int LinkDragBorderInset = 2; | 92 static const int LinkDragBorderInset = 2; |
93 static const float DragImageAlpha = 0.75f; | 93 static const float DragImageAlpha = 0.75f; |
94 | 94 |
95 static bool dragTypeIsValid(DragSourceAction action) | |
96 { | |
97 switch (action) { | |
98 case DragSourceActionDHTML: | |
99 case DragSourceActionImage: | |
100 case DragSourceActionLink: | |
101 case DragSourceActionSelection: | |
102 return true; | |
103 case DragSourceActionNone: | |
104 return false; | |
105 } | |
106 // Make sure MSVC doesn't complain that not all control paths return a value
. | |
107 return false; | |
108 } | |
109 | |
110 static PlatformMouseEvent createMouseEvent(DragData* dragData) | 95 static PlatformMouseEvent createMouseEvent(DragData* dragData) |
111 { | 96 { |
112 bool shiftKey, ctrlKey, altKey, metaKey; | 97 bool shiftKey, ctrlKey, altKey, metaKey; |
113 shiftKey = ctrlKey = altKey = metaKey = false; | 98 shiftKey = ctrlKey = altKey = metaKey = false; |
114 int keyState = dragData->modifierKeyState(); | 99 int keyState = dragData->modifierKeyState(); |
115 shiftKey = static_cast<bool>(keyState & PlatformEvent::ShiftKey); | 100 shiftKey = static_cast<bool>(keyState & PlatformEvent::ShiftKey); |
116 ctrlKey = static_cast<bool>(keyState & PlatformEvent::CtrlKey); | 101 ctrlKey = static_cast<bool>(keyState & PlatformEvent::CtrlKey); |
117 altKey = static_cast<bool>(keyState & PlatformEvent::AltKey); | 102 altKey = static_cast<bool>(keyState & PlatformEvent::AltKey); |
118 metaKey = static_cast<bool>(keyState & PlatformEvent::MetaKey); | 103 metaKey = static_cast<bool>(keyState & PlatformEvent::MetaKey); |
119 | 104 |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 return false; | 911 return false; |
927 #endif | 912 #endif |
928 } | 913 } |
929 | 914 |
930 void DragController::cleanupAfterSystemDrag() | 915 void DragController::cleanupAfterSystemDrag() |
931 { | 916 { |
932 } | 917 } |
933 | 918 |
934 } // namespace WebCore | 919 } // namespace WebCore |
935 | 920 |
OLD | NEW |