OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/focus/accelerator_handler.h" | 5 #include "views/focus/accelerator_handler.h" |
6 | 6 |
7 #include <bitset> | 7 #include <bitset> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #if defined(HAVE_XINPUT2) | 9 #if defined(HAVE_XINPUT2) |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 FocusManager* focus_manager = root->GetFocusManager(); | 165 FocusManager* focus_manager = root->GetFocusManager(); |
166 if (FocusManager::IsTabTraversalKeyEvent(keyev)) { | 166 if (FocusManager::IsTabTraversalKeyEvent(keyev)) { |
167 return root->ProcessKeyEvent(keyev) || | 167 return root->ProcessKeyEvent(keyev) || |
168 (focus_manager && !focus_manager->OnKeyEvent(keyev)); | 168 (focus_manager && !focus_manager->OnKeyEvent(keyev)); |
169 } else { | 169 } else { |
170 return (focus_manager && !focus_manager->OnKeyEvent(keyev)) || | 170 return (focus_manager && !focus_manager->OnKeyEvent(keyev)) || |
171 root->ProcessKeyEvent(keyev); | 171 root->ProcessKeyEvent(keyev); |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 case KeyRelease: | 175 case KeyRelease: { |
176 return root->ProcessKeyEvent(KeyEvent(xev)); | 176 KeyEvent keyev(xev); |
| 177 return root->ProcessKeyEvent(keyev); |
| 178 } |
177 | 179 |
178 case ButtonPress: | 180 case ButtonPress: |
179 case ButtonRelease: { | 181 case ButtonRelease: { |
180 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) { | 182 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) { |
181 // Scrolling the wheel triggers button press/release events. | 183 // Scrolling the wheel triggers button press/release events. |
182 MouseWheelEvent wheelev(xev); | 184 MouseWheelEvent wheelev(xev); |
183 return root->ProcessMouseWheelEvent(wheelev); | 185 return root->ProcessMouseWheelEvent(wheelev); |
184 } else { | 186 } else { |
185 MouseEvent mouseev(xev); | 187 MouseEvent mouseev(xev); |
186 if (xev->type == ButtonPress) { | 188 if (xev->type == ButtonPress) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 230 } |
229 | 231 |
230 base::MessagePumpGlibXDispatcher::DispatchStatus AcceleratorHandler::Dispatch( | 232 base::MessagePumpGlibXDispatcher::DispatchStatus AcceleratorHandler::Dispatch( |
231 XEvent* xev) { | 233 XEvent* xev) { |
232 return DispatchXEvent(xev) ? | 234 return DispatchXEvent(xev) ? |
233 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED : | 235 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED : |
234 base::MessagePumpGlibXDispatcher::EVENT_IGNORED; | 236 base::MessagePumpGlibXDispatcher::EVENT_IGNORED; |
235 } | 237 } |
236 | 238 |
237 } // namespace views | 239 } // namespace views |
OLD | NEW |