| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 xwindow = xiev->event; | 157 xwindow = xiev->event; |
| 158 } | 158 } |
| 159 #endif | 159 #endif |
| 160 | 160 |
| 161 GdkWindow* gwind = gdk_window_lookup_for_display(gdisp, xwindow); | 161 GdkWindow* gwind = gdk_window_lookup_for_display(gdisp, xwindow); |
| 162 | 162 |
| 163 if (RootView* root = FindRootViewForGdkWindow(gwind)) { | 163 if (RootView* root = FindRootViewForGdkWindow(gwind)) { |
| 164 switch (xev->type) { | 164 switch (xev->type) { |
| 165 case KeyPress: | 165 case KeyPress: |
| 166 case KeyRelease: { | 166 case KeyRelease: { |
| 167 KeyEvent keyev(xev); | 167 KeyEvent keyev(xev, FromNativeEvent2); |
| 168 return root->ProcessKeyEvent(keyev); | 168 return root->ProcessKeyEvent(keyev); |
| 169 } | 169 } |
| 170 | 170 |
| 171 case ButtonPress: | 171 case ButtonPress: |
| 172 case ButtonRelease: { | 172 case ButtonRelease: { |
| 173 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) { | 173 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) { |
| 174 // Scrolling the wheel triggers button press/release events. | 174 // Scrolling the wheel triggers button press/release events. |
| 175 MouseWheelEvent wheelev(xev); | 175 MouseWheelEvent wheelev(xev); |
| 176 return root->ProcessMouseWheelEvent(wheelev); | 176 return root->ProcessMouseWheelEvent(wheelev); |
| 177 } else { | 177 } else { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 221 } |
| 222 | 222 |
| 223 base::MessagePumpGlibXDispatcher::DispatchStatus AcceleratorHandler::Dispatch( | 223 base::MessagePumpGlibXDispatcher::DispatchStatus AcceleratorHandler::Dispatch( |
| 224 XEvent* xev) { | 224 XEvent* xev) { |
| 225 return DispatchXEvent(xev) ? | 225 return DispatchXEvent(xev) ? |
| 226 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED : | 226 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED : |
| 227 base::MessagePumpGlibXDispatcher::EVENT_IGNORED; | 227 base::MessagePumpGlibXDispatcher::EVENT_IGNORED; |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace views | 230 } // namespace views |
| OLD | NEW |