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

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

Issue 141273002: Code problems detected by cppcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 11 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
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 case DragSourceActionNone: 103 case DragSourceActionNone:
104 return false; 104 return false;
105 } 105 }
106 // Make sure MSVC doesn't complain that not all control paths return a value . 106 // Make sure MSVC doesn't complain that not all control paths return a value .
107 return false; 107 return false;
108 } 108 }
109 #endif 109 #endif
110 110
111 static PlatformMouseEvent createMouseEvent(DragData* dragData) 111 static PlatformMouseEvent createMouseEvent(DragData* dragData)
112 { 112 {
113 bool shiftKey, ctrlKey, altKey, metaKey;
114 shiftKey = ctrlKey = altKey = metaKey = false;
115 int keyState = dragData->modifierKeyState(); 113 int keyState = dragData->modifierKeyState();
116 shiftKey = static_cast<bool>(keyState & PlatformEvent::ShiftKey); 114 bool shiftKey = static_cast<bool>(keyState & PlatformEvent::ShiftKey);
117 ctrlKey = static_cast<bool>(keyState & PlatformEvent::CtrlKey); 115 bool ctrlKey = static_cast<bool>(keyState & PlatformEvent::CtrlKey);
118 altKey = static_cast<bool>(keyState & PlatformEvent::AltKey); 116 bool altKey = static_cast<bool>(keyState & PlatformEvent::AltKey);
119 metaKey = static_cast<bool>(keyState & PlatformEvent::MetaKey); 117 bool metaKey = static_cast<bool>(keyState & PlatformEvent::MetaKey);
120 118
121 return PlatformMouseEvent(dragData->clientPosition(), dragData->globalPositi on(), 119 return PlatformMouseEvent(dragData->clientPosition(), dragData->globalPositi on(),
122 LeftButton, PlatformEvent::MouseMoved, 0, shiftKey , ctrlKey, altKey, 120 LeftButton, PlatformEvent::MouseMoved, 0, shiftKey , ctrlKey, altKey,
123 metaKey, currentTime()); 121 metaKey, currentTime());
124 } 122 }
125 123
126 static PassRefPtr<Clipboard> createDraggingClipboard(ClipboardAccessPolicy polic y, DragData* dragData) 124 static PassRefPtr<Clipboard> createDraggingClipboard(ClipboardAccessPolicy polic y, DragData* dragData)
127 { 125 {
128 return Clipboard::create(Clipboard::DragAndDrop, policy, dragData->platformD ata()); 126 return Clipboard::create(Clipboard::DragAndDrop, policy, dragData->platformD ata());
129 } 127 }
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 return false; 957 return false;
960 #endif 958 #endif
961 } 959 }
962 960
963 void DragController::cleanupAfterSystemDrag() 961 void DragController::cleanupAfterSystemDrag()
964 { 962 {
965 } 963 }
966 964
967 } // namespace WebCore 965 } // namespace WebCore
968 966
OLDNEW
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698