Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: Source/web/InspectorOverlayImpl.cpp

Issue 1317913004: Devtools [LayoutEditor]: show selector info and highlight affected nodes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cursor2
Patch Set: Address comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/InspectorOverlayImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 handled = handleTouchEvent(touchEvent); 277 handled = handleTouchEvent(touchEvent);
278 if (handled) 278 if (handled)
279 return true; 279 return true;
280 overlayMainFrame()->eventHandler().handleTouchEvent(touchEvent); 280 overlayMainFrame()->eventHandler().handleTouchEvent(touchEvent);
281 } 281 }
282 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) { 282 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) {
283 PlatformKeyboardEvent keyboardEvent = PlatformKeyboardEventBuilder(stati c_cast<const WebKeyboardEvent&>(inputEvent)); 283 PlatformKeyboardEvent keyboardEvent = PlatformKeyboardEventBuilder(stati c_cast<const WebKeyboardEvent&>(inputEvent));
284 overlayMainFrame()->eventHandler().keyEvent(keyboardEvent); 284 overlayMainFrame()->eventHandler().keyEvent(keyboardEvent);
285 } 285 }
286 286
287 if (inputEvent.type == WebInputEvent::MouseWheel) {
288 PlatformWheelEvent wheelEvent = PlatformWheelEventBuilder(m_webViewImpl- >mainFrameImpl()->frameView(), static_cast<const WebMouseWheelEvent&>(inputEvent ));
289 handled = overlayMainFrame()->eventHandler().handleWheelEvent(wheelEvent );
290 }
291
287 return handled; 292 return handled;
288 } 293 }
289 294
290 void InspectorOverlayImpl::setPausedInDebuggerMessage(const String* message) 295 void InspectorOverlayImpl::setPausedInDebuggerMessage(const String* message)
291 { 296 {
292 m_pausedInDebuggerMessage = message ? *message : String(); 297 m_pausedInDebuggerMessage = message ? *message : String();
293 update(); 298 update();
294 } 299 }
295 300
296 void InspectorOverlayImpl::hideHighlight() 301 void InspectorOverlayImpl::hideHighlight()
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 370
366 void InspectorOverlayImpl::rebuildOverlayPage() 371 void InspectorOverlayImpl::rebuildOverlayPage()
367 { 372 {
368 FrameView* view = m_webViewImpl->mainFrameImpl()->frameView(); 373 FrameView* view = m_webViewImpl->mainFrameImpl()->frameView();
369 if (!view) 374 if (!view)
370 return; 375 return;
371 376
372 IntRect visibleRectInDocument = view->scrollableArea()->visibleContentRect() ; 377 IntRect visibleRectInDocument = view->scrollableArea()->visibleContentRect() ;
373 IntSize viewportSize = m_webViewImpl->page()->frameHost().visualViewport().s ize(); 378 IntSize viewportSize = m_webViewImpl->page()->frameHost().visualViewport().s ize();
374 toLocalFrame(overlayPage()->mainFrame())->view()->resize(viewportSize); 379 toLocalFrame(overlayPage()->mainFrame())->view()->resize(viewportSize);
380 overlayPage()->frameHost().visualViewport().setSize(viewportSize);
375 reset(viewportSize, visibleRectInDocument.location()); 381 reset(viewportSize, visibleRectInDocument.location());
376 382
377 drawNodeHighlight(); 383 drawNodeHighlight();
378 drawQuadHighlight(); 384 drawQuadHighlight();
379 drawPausedInDebuggerMessage(); 385 drawPausedInDebuggerMessage();
380 drawViewSize(); 386 drawViewSize();
381 } 387 }
382 388
383 static PassRefPtr<JSONObject> buildObjectForSize(const IntSize& size) 389 static PassRefPtr<JSONObject> buildObjectForSize(const IntSize& size)
384 { 390 {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 void InspectorOverlayImpl::overlayPropertyChanged(float value) 578 void InspectorOverlayImpl::overlayPropertyChanged(float value)
573 { 579 {
574 m_layoutEditor->overlayPropertyChanged(value); 580 m_layoutEditor->overlayPropertyChanged(value);
575 } 581 }
576 582
577 void InspectorOverlayImpl::overlayEndedPropertyChange() 583 void InspectorOverlayImpl::overlayEndedPropertyChange()
578 { 584 {
579 m_layoutEditor->overlayEndedPropertyChange(); 585 m_layoutEditor->overlayEndedPropertyChange();
580 } 586 }
581 587
588 void InspectorOverlayImpl::overlayNextSelector()
589 {
590 m_layoutEditor->nextSelector();
591 }
592
593 void InspectorOverlayImpl::overlayPreviousSelector()
594 {
595 m_layoutEditor->previousSelector();
596 }
597
598 String InspectorOverlayImpl::overlayCurrentSelectorInfo()
599 {
600 return m_layoutEditor->currentSelectorInfo();
601 }
602
582 void InspectorOverlayImpl::overlayClearSelection(bool commitChanges) 603 void InspectorOverlayImpl::overlayClearSelection(bool commitChanges)
583 { 604 {
584 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor) 605 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor)
585 return; 606 return;
586 607
587 m_searchingInLayoutEditor = true; 608 m_searchingInLayoutEditor = true;
588 if (m_layoutEditor->node() && m_inspectModeHighlightConfig) { 609 if (m_layoutEditor->node() && m_inspectModeHighlightConfig) {
589 m_hoveredNodeForInspectMode = m_layoutEditor->node(); 610 m_hoveredNodeForInspectMode = m_layoutEditor->node();
590 highlightNode(m_layoutEditor->node(), *m_inspectModeHighlightConfig, fal se); 611 highlightNode(m_layoutEditor->node(), *m_inspectModeHighlightConfig, fal se);
591 } 612 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 728
708 if (m_layoutEditor && m_inspectMode == InspectorDOMAgent::ShowLayoutEditor & & m_searchingInLayoutEditor) { 729 if (m_layoutEditor && m_inspectMode == InspectorDOMAgent::ShowLayoutEditor & & m_searchingInLayoutEditor) {
709 m_searchingInLayoutEditor = false; 730 m_searchingInLayoutEditor = false;
710 m_layoutEditor->selectNode(node); 731 m_layoutEditor->selectNode(node);
711 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverr idden(true); 732 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverr idden(true);
712 highlightNode(node, *m_inspectModeHighlightConfig, false); 733 highlightNode(node, *m_inspectModeHighlightConfig, false);
713 } 734 }
714 } 735 }
715 736
716 } // namespace blink 737 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/InspectorOverlayImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698