| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 | 8 |
| 9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
| 10 #include "Cursor.h" | 10 #include "Cursor.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 event.y != last_mouse_position_.y) { | 90 event.y != last_mouse_position_.y) { |
| 91 last_mouse_position_ = WebPoint(event.x, event.y); | 91 last_mouse_position_ = WebPoint(event.x, event.y); |
| 92 widget_->handleMouseMoveEvent(MakePlatformMouseEvent(widget_, event)); | 92 widget_->handleMouseMoveEvent(MakePlatformMouseEvent(widget_, event)); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 void WebWidgetImpl::MouseLeave(const WebMouseEvent& event) { | 96 void WebWidgetImpl::MouseLeave(const WebMouseEvent& event) { |
| 97 widget_->handleMouseMoveEvent(MakePlatformMouseEvent(widget_, event)); | 97 widget_->handleMouseMoveEvent(MakePlatformMouseEvent(widget_, event)); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void WebWidgetImpl::MouseDown(const WebMouseEvent& event) { | 100 bool WebWidgetImpl::MouseDown(const WebMouseEvent& event) { |
| 101 widget_->handleMouseDownEvent(MakePlatformMouseEvent(widget_, event)); | 101 return widget_->handleMouseDownEvent(MakePlatformMouseEvent(widget_, event)); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void WebWidgetImpl::MouseUp(const WebMouseEvent& event) { | 104 bool WebWidgetImpl::MouseUp(const WebMouseEvent& event) { |
| 105 MouseCaptureLost(); | 105 MouseCaptureLost(); |
| 106 widget_->handleMouseReleaseEvent(MakePlatformMouseEvent(widget_, event)); | 106 return widget_->handleMouseReleaseEvent( |
| 107 MakePlatformMouseEvent(widget_, event)); |
| 107 } | 108 } |
| 108 | 109 |
| 109 void WebWidgetImpl::MouseWheel(const WebMouseWheelEvent& event) { | 110 void WebWidgetImpl::MouseWheel(const WebMouseWheelEvent& event) { |
| 110 widget_->handleWheelEvent(MakePlatformWheelEvent(widget_, event)); | 111 widget_->handleWheelEvent(MakePlatformWheelEvent(widget_, event)); |
| 111 } | 112 } |
| 112 | 113 |
| 113 bool WebWidgetImpl::KeyEvent(const WebKeyboardEvent& event) { | 114 bool WebWidgetImpl::KeyEvent(const WebKeyboardEvent& event) { |
| 114 return widget_->handleKeyEvent(MakePlatformKeyboardEvent(event)); | 115 return widget_->handleKeyEvent(MakePlatformKeyboardEvent(event)); |
| 115 } | 116 } |
| 116 | 117 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 177 |
| 177 case WebInputEvent::MouseLeave: | 178 case WebInputEvent::MouseLeave: |
| 178 MouseLeave(*static_cast<const WebMouseEvent*>(input_event)); | 179 MouseLeave(*static_cast<const WebMouseEvent*>(input_event)); |
| 179 return true; | 180 return true; |
| 180 | 181 |
| 181 case WebInputEvent::MouseWheel: | 182 case WebInputEvent::MouseWheel: |
| 182 MouseWheel(*static_cast<const WebMouseWheelEvent*>(input_event)); | 183 MouseWheel(*static_cast<const WebMouseWheelEvent*>(input_event)); |
| 183 return true; | 184 return true; |
| 184 | 185 |
| 185 case WebInputEvent::MouseDown: | 186 case WebInputEvent::MouseDown: |
| 186 MouseDown(*static_cast<const WebMouseEvent*>(input_event)); | 187 return MouseDown(*static_cast<const WebMouseEvent*>(input_event)); |
| 187 return true; | |
| 188 | 188 |
| 189 case WebInputEvent::MouseUp: | 189 case WebInputEvent::MouseUp: |
| 190 MouseUp(*static_cast<const WebMouseEvent*>(input_event)); | 190 return MouseUp(*static_cast<const WebMouseEvent*>(input_event)); |
| 191 return true; | |
| 192 | 191 |
| 193 // In Windows, RawKeyDown only has information about the physical key, but | 192 // In Windows, RawKeyDown only has information about the physical key, but |
| 194 // for "selection", we need the information about the character the key | 193 // for "selection", we need the information about the character the key |
| 195 // translated into. For English, the physical key value and the character | 194 // translated into. For English, the physical key value and the character |
| 196 // value are the same, hence, "selection" works for English. But for other | 195 // value are the same, hence, "selection" works for English. But for other |
| 197 // languages, such as Hebrew, the character value is different from the | 196 // languages, such as Hebrew, the character value is different from the |
| 198 // physical key value. Thus, without accepting Char event type which | 197 // physical key value. Thus, without accepting Char event type which |
| 199 // contains the key's character value, the "selection" won't work for | 198 // contains the key's character value, the "selection" won't work for |
| 200 // non-English languages, such as Hebrew. | 199 // non-English languages, such as Hebrew. |
| 201 case WebInputEvent::RawKeyDown: | 200 case WebInputEvent::RawKeyDown: |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // WebCore::FramelessScrollViewClient | 285 // WebCore::FramelessScrollViewClient |
| 287 | 286 |
| 288 void WebWidgetImpl::popupClosed(WebCore::FramelessScrollView* widget) { | 287 void WebWidgetImpl::popupClosed(WebCore::FramelessScrollView* widget) { |
| 289 DCHECK(widget == widget_); | 288 DCHECK(widget == widget_); |
| 290 if (widget_) { | 289 if (widget_) { |
| 291 widget_->setClient(NULL); | 290 widget_->setClient(NULL); |
| 292 widget_ = NULL; | 291 widget_ = NULL; |
| 293 } | 292 } |
| 294 delegate_->CloseWidgetSoon(this); | 293 delegate_->CloseWidgetSoon(this); |
| 295 } | 294 } |
| OLD | NEW |