OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 if (m_scrollbar->hoveredPart() != blink::NoPart) | 316 if (m_scrollbar->hoveredPart() != blink::NoPart) |
317 m_scrollbar->mouseExited(); | 317 m_scrollbar->mouseExited(); |
318 | 318 |
319 return false; | 319 return false; |
320 } | 320 } |
321 | 321 |
322 bool WebPluginScrollbarImpl::onMouseWheel(const WebInputEvent& event) | 322 bool WebPluginScrollbarImpl::onMouseWheel(const WebInputEvent& event) |
323 { | 323 { |
324 WebMouseWheelEvent mousewheel = static_cast<const WebMouseWheelEvent&>(event
); | 324 WebMouseWheelEvent mousewheel = static_cast<const WebMouseWheelEvent&>(event
); |
325 PlatformWheelEventBuilder platformEvent(m_scrollbar.get(), mousewheel); | 325 PlatformWheelEventBuilder platformEvent(m_scrollbar.get(), mousewheel); |
326 return m_group->handleWheel(platformEvent).didScroll; | 326 return m_group->handleWheel(platformEvent).didScroll(); |
327 } | 327 } |
328 | 328 |
329 bool WebPluginScrollbarImpl::onKeyDown(const WebInputEvent& event) | 329 bool WebPluginScrollbarImpl::onKeyDown(const WebInputEvent& event) |
330 { | 330 { |
331 WebKeyboardEvent keyboard = static_cast<const WebKeyboardEvent&>(event); | 331 WebKeyboardEvent keyboard = static_cast<const WebKeyboardEvent&>(event); |
332 int keyCode; | 332 int keyCode; |
333 // We have to duplicate this logic from WebViewImpl because there it uses | 333 // We have to duplicate this logic from WebViewImpl because there it uses |
334 // Char and RawKeyDown events, which don't exist at this point. | 334 // Char and RawKeyDown events, which don't exist at this point. |
335 if (keyboard.windowsKeyCode == VKEY_SPACE) | 335 if (keyboard.windowsKeyCode == VKEY_SPACE) |
336 keyCode = ((keyboard.modifiers & WebInputEvent::ShiftKey) ? VKEY_PRIOR :
VKEY_NEXT); | 336 keyCode = ((keyboard.modifiers & WebInputEvent::ShiftKey) ? VKEY_PRIOR :
VKEY_NEXT); |
(...skipping 14 matching lines...) Expand all Loading... |
351 | 351 |
352 if (keyboard.isSystemKey || (keyboard.modifiers & WebInputEvent::ShiftKe
y)) | 352 if (keyboard.isSystemKey || (keyboard.modifiers & WebInputEvent::ShiftKe
y)) |
353 return false; | 353 return false; |
354 | 354 |
355 keyCode = keyboard.windowsKeyCode; | 355 keyCode = keyboard.windowsKeyCode; |
356 } | 356 } |
357 blink::ScrollDirectionPhysical scrollDirection; | 357 blink::ScrollDirectionPhysical scrollDirection; |
358 blink::ScrollGranularity scrollGranularity; | 358 blink::ScrollGranularity scrollGranularity; |
359 if (WebViewImpl::mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranu
larity)) { | 359 if (WebViewImpl::mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranu
larity)) { |
360 // Will return false if scroll direction wasn't compatible with this scr
ollbar. | 360 // Will return false if scroll direction wasn't compatible with this scr
ollbar. |
361 return m_group->scroll(scrollDirection, scrollGranularity); | 361 return m_group->scroll(scrollDirection, scrollGranularity).didScroll; |
362 } | 362 } |
363 return false; | 363 return false; |
364 } | 364 } |
365 | 365 |
366 float WebPluginScrollbarImpl::elasticOverscroll() const | 366 float WebPluginScrollbarImpl::elasticOverscroll() const |
367 { | 367 { |
368 return m_scrollbar->elasticOverscroll(); | 368 return m_scrollbar->elasticOverscroll(); |
369 } | 369 } |
370 | 370 |
371 void WebPluginScrollbarImpl::setElasticOverscroll(float elasticOverscroll) | 371 void WebPluginScrollbarImpl::setElasticOverscroll(float elasticOverscroll) |
372 { | 372 { |
373 m_scrollbar->setElasticOverscroll(elasticOverscroll); | 373 m_scrollbar->setElasticOverscroll(elasticOverscroll); |
374 } | 374 } |
375 | 375 |
376 } // namespace blink | 376 } // namespace blink |
OLD | NEW |