OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 371 |
372 return toLocalFrame(overlayPage()->mainFrame())->eventHandler().handleGestur
eEvent(event); | 372 return toLocalFrame(overlayPage()->mainFrame())->eventHandler().handleGestur
eEvent(event); |
373 } | 373 } |
374 | 374 |
375 bool InspectorOverlay::handleMouseEvent(const PlatformMouseEvent& event) | 375 bool InspectorOverlay::handleMouseEvent(const PlatformMouseEvent& event) |
376 { | 376 { |
377 if (isEmpty()) | 377 if (isEmpty()) |
378 return false; | 378 return false; |
379 | 379 |
380 EventHandler& eventHandler = toLocalFrame(overlayPage()->mainFrame())->event
Handler(); | 380 EventHandler& eventHandler = toLocalFrame(overlayPage()->mainFrame())->event
Handler(); |
381 bool result; | |
382 switch (event.type()) { | 381 switch (event.type()) { |
383 case PlatformEvent::MouseMoved: | 382 case PlatformEvent::MouseMoved: |
384 result = eventHandler.handleMouseMoveEvent(event); | 383 return eventHandler.handleMouseMoveEvent(event); |
385 break; | |
386 case PlatformEvent::MousePressed: | 384 case PlatformEvent::MousePressed: |
387 result = eventHandler.handleMousePressEvent(event); | 385 return eventHandler.handleMousePressEvent(event); |
388 break; | |
389 case PlatformEvent::MouseReleased: | 386 case PlatformEvent::MouseReleased: |
390 result = eventHandler.handleMouseReleaseEvent(event); | 387 return eventHandler.handleMouseReleaseEvent(event); |
391 break; | |
392 default: | 388 default: |
393 return false; | 389 return false; |
394 } | 390 } |
395 | |
396 toLocalFrame(overlayPage()->mainFrame())->document()->updateLayout(); | |
397 return result; | |
398 } | 391 } |
399 | 392 |
400 bool InspectorOverlay::handleTouchEvent(const PlatformTouchEvent& event) | 393 bool InspectorOverlay::handleTouchEvent(const PlatformTouchEvent& event) |
401 { | 394 { |
402 if (isEmpty()) | 395 if (isEmpty()) |
403 return false; | 396 return false; |
404 | 397 |
405 return toLocalFrame(overlayPage()->mainFrame())->eventHandler().handleTouchE
vent(event); | 398 return toLocalFrame(overlayPage()->mainFrame())->eventHandler().handleTouchE
vent(event); |
406 } | 399 } |
407 | 400 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 // Clear canvas and paint things. | 489 // Clear canvas and paint things. |
497 IntRect viewRect = view->visibleContentRect(); | 490 IntRect viewRect = view->visibleContentRect(); |
498 reset(size, viewRect.x(), viewRect.y()); | 491 reset(size, viewRect.x(), viewRect.y()); |
499 | 492 |
500 drawNodeHighlight(); | 493 drawNodeHighlight(); |
501 drawQuadHighlight(); | 494 drawQuadHighlight(); |
502 if (!m_inspectModeEnabled) | 495 if (!m_inspectModeEnabled) |
503 drawPausedInDebuggerMessage(); | 496 drawPausedInDebuggerMessage(); |
504 drawViewSize(); | 497 drawViewSize(); |
505 | 498 |
506 // Position DOM elements. | 499 toLocalFrame(overlayPage()->mainFrame())->view()->updateLayoutAndStyleForPai
nting(); |
507 toLocalFrame(overlayPage()->mainFrame())->document()->setNeedsStyleRecalc(Su
btreeStyleChange); | |
508 toLocalFrame(overlayPage()->mainFrame())->document()->updateLayout(); | |
509 | 500 |
510 // Kick paint. | |
511 m_client->highlight(); | 501 m_client->highlight(); |
512 } | 502 } |
513 | 503 |
514 void InspectorOverlay::hide() | 504 void InspectorOverlay::hide() |
515 { | 505 { |
516 m_timer.stop(); | 506 m_timer.stop(); |
517 m_highlightNode.clear(); | 507 m_highlightNode.clear(); |
518 m_eventTargetNode.clear(); | 508 m_eventTargetNode.clear(); |
519 m_highlightQuad.clear(); | 509 m_highlightQuad.clear(); |
520 m_pausedInDebuggerMessage = String(); | 510 m_pausedInDebuggerMessage = String(); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 hideHighlight(); | 846 hideHighlight(); |
857 } | 847 } |
858 | 848 |
859 void InspectorOverlay::startedRecordingProfile() | 849 void InspectorOverlay::startedRecordingProfile() |
860 { | 850 { |
861 if (!m_activeProfilerCount++) | 851 if (!m_activeProfilerCount++) |
862 freePage(); | 852 freePage(); |
863 } | 853 } |
864 | 854 |
865 } // namespace blink | 855 } // namespace blink |
OLD | NEW |