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/ui/views/tab_contents/tab_contents_container.h" | 5 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" |
6 | 6 |
7 #if defined(HAVE_XINPUT2) | 7 #if defined(HAVE_XINPUT2) |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 #if defined(HAVE_XINPUT2) | 76 #if defined(HAVE_XINPUT2) |
77 bool TabContentsContainer::OnMousePressed(const views::MouseEvent& event) { | 77 bool TabContentsContainer::OnMousePressed(const views::MouseEvent& event) { |
78 DCHECK(tab_contents_); | 78 DCHECK(tab_contents_); |
79 if (event.flags() & (ui::EF_LEFT_BUTTON_DOWN | | 79 if (event.flags() & (ui::EF_LEFT_BUTTON_DOWN | |
80 ui::EF_RIGHT_BUTTON_DOWN | | 80 ui::EF_RIGHT_BUTTON_DOWN | |
81 ui::EF_MIDDLE_BUTTON_DOWN)) { | 81 ui::EF_MIDDLE_BUTTON_DOWN)) { |
82 return false; | 82 return false; |
83 } | 83 } |
84 // It is necessary to look at the native event to determine what special | 84 // It is necessary to look at the native event to determine what special |
85 // button was pressed. | 85 // button was pressed. |
86 views::NativeEvent2 native_event = event.native_event_2(); | 86 views::NativeEvent native_event = event.native_event(); |
87 if (!native_event) | 87 if (!native_event) |
88 return false; | 88 return false; |
89 | 89 |
90 int button = 0; | 90 int button = 0; |
91 switch (native_event->type) { | 91 switch (native_event->type) { |
92 case ButtonPress: { | 92 case ButtonPress: { |
93 button = native_event->xbutton.button; | 93 button = native_event->xbutton.button; |
94 break; | 94 break; |
95 } | 95 } |
96 case GenericEvent: { | 96 case GenericEvent: { |
(...skipping 29 matching lines...) Expand all Loading... |
126 | 126 |
127 //////////////////////////////////////////////////////////////////////////////// | 127 //////////////////////////////////////////////////////////////////////////////// |
128 // TabContentsContainer, private: | 128 // TabContentsContainer, private: |
129 | 129 |
130 void TabContentsContainer::RenderViewHostChanged(RenderViewHost* old_host, | 130 void TabContentsContainer::RenderViewHostChanged(RenderViewHost* old_host, |
131 RenderViewHost* new_host) { | 131 RenderViewHost* new_host) { |
132 if (new_host) | 132 if (new_host) |
133 RenderWidgetHostViewChanged(new_host->view()); | 133 RenderWidgetHostViewChanged(new_host->view()); |
134 native_container_->RenderViewHostChanged(old_host, new_host); | 134 native_container_->RenderViewHostChanged(old_host, new_host); |
135 } | 135 } |
OLD | NEW |