OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/frame/panel_controller.h" | 5 #include "chrome/browser/chromeos/frame/panel_controller.h" |
6 | 6 |
7 #if defined(TOUCH_UI) | 7 #if defined(TOUCH_UI) |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #if defined(HAVE_XINPUT2) | |
10 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
11 #endif | 10 #endif |
12 #endif | |
13 | 11 |
14 #include <vector> | 12 #include <vector> |
15 | 13 |
16 #include "base/logging.h" | 14 #include "base/logging.h" |
17 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
19 #include "base/string_util.h" | 17 #include "base/string_util.h" |
20 #include "base/time.h" | 18 #include "base/time.h" |
21 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
22 #include "chrome/browser/chromeos/wm_ipc.h" | 20 #include "chrome/browser/chromeos/wm_ipc.h" |
(...skipping 19 matching lines...) Expand all Loading... |
42 namespace { | 40 namespace { |
43 | 41 |
44 gfx::Point RootLocationFromXEvent(const XEvent* xev) { | 42 gfx::Point RootLocationFromXEvent(const XEvent* xev) { |
45 switch (xev->type) { | 43 switch (xev->type) { |
46 case ButtonPress: | 44 case ButtonPress: |
47 case ButtonRelease: | 45 case ButtonRelease: |
48 return gfx::Point(xev->xbutton.x_root, xev->xbutton.y_root); | 46 return gfx::Point(xev->xbutton.x_root, xev->xbutton.y_root); |
49 case MotionNotify: | 47 case MotionNotify: |
50 return gfx::Point(xev->xmotion.x_root, xev->xmotion.y_root); | 48 return gfx::Point(xev->xmotion.x_root, xev->xmotion.y_root); |
51 | 49 |
52 #if defined(HAVE_XINPUT2) | |
53 case GenericEvent: { | 50 case GenericEvent: { |
54 const XIDeviceEvent* xiev = | 51 const XIDeviceEvent* xiev = |
55 static_cast<XIDeviceEvent*>(xev->xcookie.data); | 52 static_cast<XIDeviceEvent*>(xev->xcookie.data); |
56 switch (xiev->evtype) { | 53 switch (xiev->evtype) { |
57 case XI_ButtonPress: | 54 case XI_ButtonPress: |
58 case XI_ButtonRelease: | 55 case XI_ButtonRelease: |
59 case XI_Motion: | 56 case XI_Motion: |
60 return gfx::Point(static_cast<int>(xiev->root_x), | 57 return gfx::Point(static_cast<int>(xiev->root_x), |
61 static_cast<int>(xiev->root_y)); | 58 static_cast<int>(xiev->root_y)); |
62 } | 59 } |
63 } | 60 } |
64 #endif // defined(HAVE_XINPUT2) | |
65 | 61 |
66 default: | 62 default: |
67 NOTREACHED(); | 63 NOTREACHED(); |
68 } | 64 } |
69 | 65 |
70 return gfx::Point(); | 66 return gfx::Point(); |
71 } | 67 } |
72 | 68 |
73 } // namespace | 69 } // namespace |
74 #endif // defined(TOUCH_UI) | 70 #endif // defined(TOUCH_UI) |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 views::Button* sender, const views::Event& event) { | 508 views::Button* sender, const views::Event& event) { |
513 if (panel_controller_ && sender == close_button_) | 509 if (panel_controller_ && sender == close_button_) |
514 panel_controller_->OnCloseButtonPressed(); | 510 panel_controller_->OnCloseButtonPressed(); |
515 } | 511 } |
516 | 512 |
517 PanelController::TitleContentView::~TitleContentView() { | 513 PanelController::TitleContentView::~TitleContentView() { |
518 VLOG(1) << "panel: delete " << this; | 514 VLOG(1) << "panel: delete " << this; |
519 } | 515 } |
520 | 516 |
521 } // namespace chromeos | 517 } // namespace chromeos |
OLD | NEW |