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

Side by Side Diff: content/child/npapi/webplugin_delegate_impl_win.cc

Issue 1294003002: clang/win: Enable -Wswitch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 5 years, 4 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 | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/child/npapi/webplugin_delegate_impl.h" 5 #include "content/child/npapi/webplugin_delegate_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 focus_event.event = focused ? WM_SETFOCUS : WM_KILLFOCUS; 1085 focus_event.event = focused ? WM_SETFOCUS : WM_KILLFOCUS;
1086 focus_event.wParam = 0; 1086 focus_event.wParam = 0;
1087 focus_event.lParam = 0; 1087 focus_event.lParam = 0;
1088 1088
1089 instance()->NPP_HandleEvent(&focus_event); 1089 instance()->NPP_HandleEvent(&focus_event);
1090 return true; 1090 return true;
1091 } 1091 }
1092 1092
1093 static bool NPEventFromWebMouseEvent(const WebMouseEvent& event, 1093 static bool NPEventFromWebMouseEvent(const WebMouseEvent& event,
1094 NPEvent* np_event) { 1094 NPEvent* np_event) {
1095 np_event->lParam = static_cast<uint32>(MAKELPARAM(event.windowX, 1095 np_event->lParam =
1096 event.windowY)); 1096 static_cast<uint32>(MAKELPARAM(event.windowX, event.windowY));
1097 np_event->wParam = 0; 1097 np_event->wParam = 0;
1098 1098
1099 if (event.modifiers & WebInputEvent::ControlKey) 1099 if (event.modifiers & WebInputEvent::ControlKey)
1100 np_event->wParam |= MK_CONTROL; 1100 np_event->wParam |= MK_CONTROL;
1101 if (event.modifiers & WebInputEvent::ShiftKey) 1101 if (event.modifiers & WebInputEvent::ShiftKey)
1102 np_event->wParam |= MK_SHIFT; 1102 np_event->wParam |= MK_SHIFT;
1103 if (event.modifiers & WebInputEvent::LeftButtonDown) 1103 if (event.modifiers & WebInputEvent::LeftButtonDown)
1104 np_event->wParam |= MK_LBUTTON; 1104 np_event->wParam |= MK_LBUTTON;
1105 if (event.modifiers & WebInputEvent::MiddleButtonDown) 1105 if (event.modifiers & WebInputEvent::MiddleButtonDown)
1106 np_event->wParam |= MK_MBUTTON; 1106 np_event->wParam |= MK_MBUTTON;
(...skipping 10 matching lines...) Expand all
1117 switch (event.button) { 1117 switch (event.button) {
1118 case WebMouseEvent::ButtonLeft: 1118 case WebMouseEvent::ButtonLeft:
1119 np_event->event = WM_LBUTTONDOWN; 1119 np_event->event = WM_LBUTTONDOWN;
1120 break; 1120 break;
1121 case WebMouseEvent::ButtonMiddle: 1121 case WebMouseEvent::ButtonMiddle:
1122 np_event->event = WM_MBUTTONDOWN; 1122 np_event->event = WM_MBUTTONDOWN;
1123 break; 1123 break;
1124 case WebMouseEvent::ButtonRight: 1124 case WebMouseEvent::ButtonRight:
1125 np_event->event = WM_RBUTTONDOWN; 1125 np_event->event = WM_RBUTTONDOWN;
1126 break; 1126 break;
1127 case WebMouseEvent::ButtonNone:
1128 break;
1127 } 1129 }
1128 return true; 1130 return true;
1129 case WebInputEvent::MouseUp: 1131 case WebInputEvent::MouseUp:
1130 switch (event.button) { 1132 switch (event.button) {
1131 case WebMouseEvent::ButtonLeft: 1133 case WebMouseEvent::ButtonLeft:
1132 np_event->event = WM_LBUTTONUP; 1134 np_event->event = WM_LBUTTONUP;
1133 break; 1135 break;
1134 case WebMouseEvent::ButtonMiddle: 1136 case WebMouseEvent::ButtonMiddle:
1135 np_event->event = WM_MBUTTONUP; 1137 np_event->event = WM_MBUTTONUP;
1136 break; 1138 break;
1137 case WebMouseEvent::ButtonRight: 1139 case WebMouseEvent::ButtonRight:
1138 np_event->event = WM_RBUTTONUP; 1140 np_event->event = WM_RBUTTONUP;
1139 break; 1141 break;
1142 case WebMouseEvent::ButtonNone:
1143 break;
1140 } 1144 }
1141 return true; 1145 return true;
1142 default: 1146 default:
1143 NOTREACHED(); 1147 NOTREACHED();
1144 return false; 1148 return false;
1145 } 1149 }
1146 } 1150 }
1147 1151
1148 static bool NPEventFromWebKeyboardEvent(const WebKeyboardEvent& event, 1152 static bool NPEventFromWebKeyboardEvent(const WebKeyboardEvent& event,
1149 NPEvent* np_event) { 1153 NPEvent* np_event) {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 case WM_RBUTTONUP: 1483 case WM_RBUTTONUP:
1480 ::ReleaseCapture(); 1484 ::ReleaseCapture();
1481 break; 1485 break;
1482 1486
1483 default: 1487 default:
1484 break; 1488 break;
1485 } 1489 }
1486 } 1490 }
1487 1491
1488 } // namespace content 1492 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698