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

Side by Side Diff: third_party/WebKit/Source/web/InspectorOverlay.cpp

Issue 1957303003: [DevTools] Fix InspectorOverlay breakage after suspend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 4 years, 7 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 | « third_party/WebKit/Source/web/InspectorOverlay.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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 v8::Local<v8::Value> string = toLocalFrame(overlayPage()->mainFrame())->scri pt().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script), ScriptCont roller::ExecuteScriptWhenScriptsDisabled); 564 v8::Local<v8::Value> string = toLocalFrame(overlayPage()->mainFrame())->scri pt().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script), ScriptCont roller::ExecuteScriptWhenScriptsDisabled);
565 return toCoreStringWithUndefinedOrNullCheck(string); 565 return toCoreStringWithUndefinedOrNullCheck(string);
566 } 566 }
567 567
568 void InspectorOverlay::onTimer(Timer<InspectorOverlay>*) 568 void InspectorOverlay::onTimer(Timer<InspectorOverlay>*)
569 { 569 {
570 m_resizeTimerActive = false; 570 m_resizeTimerActive = false;
571 scheduleUpdate(); 571 scheduleUpdate();
572 } 572 }
573 573
574 void InspectorOverlay::clear() 574 void InspectorOverlay::clearInternal()
575 { 575 {
576 if (m_layoutEditor) 576 if (m_layoutEditor)
577 m_layoutEditor.clear(); 577 m_layoutEditor.clear();
578 578
579 if (m_overlayPage) { 579 if (m_overlayPage) {
580 m_overlayPage->willBeDestroyed(); 580 m_overlayPage->willBeDestroyed();
581 m_overlayPage.clear(); 581 m_overlayPage.clear();
582 m_overlayChromeClient.clear(); 582 m_overlayChromeClient.clear();
583 } 583 }
584 m_resizeTimerActive = false; 584 m_resizeTimerActive = false;
585 m_pausedInDebuggerMessage = String(); 585 m_pausedInDebuggerMessage = String();
586 m_inspectMode = InspectorDOMAgent::NotSearching; 586 m_inspectMode = InspectorDOMAgent::NotSearching;
587 m_timer.stop(); 587 m_timer.stop();
588 hideHighlight(); 588 hideHighlight();
589 }
589 590
591 void InspectorOverlay::clear()
592 {
593 clearInternal();
590 m_debuggerAgent.clear(); 594 m_debuggerAgent.clear();
591 m_domAgent.clear(); 595 m_domAgent.clear();
592 m_cssAgent.clear(); 596 m_cssAgent.clear();
593 m_overlayHost->setListener(nullptr); 597 m_overlayHost->setListener(nullptr);
594 } 598 }
595 599
596 void InspectorOverlay::overlayResumed() 600 void InspectorOverlay::overlayResumed()
597 { 601 {
598 if (m_debuggerAgent) { 602 if (m_debuggerAgent) {
599 ErrorString error; 603 ErrorString error;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 if (m_inspectModeHighlightConfig) 659 if (m_inspectModeHighlightConfig)
656 highlightNode(m_hoveredNodeForInspectMode.get(), *m_inspectModeHighlight Config, false); 660 highlightNode(m_hoveredNodeForInspectMode.get(), *m_inspectModeHighlight Config, false);
657 661
658 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde n(false); 662 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde n(false);
659 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursor(pointerC ursor(), overlayMainFrame()); 663 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursor(pointerC ursor(), overlayMainFrame());
660 } 664 }
661 665
662 void InspectorOverlay::profilingStarted() 666 void InspectorOverlay::profilingStarted()
663 { 667 {
664 if (!m_suspendCount++) 668 if (!m_suspendCount++)
665 clear(); 669 clearInternal();
666 } 670 }
667 671
668 void InspectorOverlay::profilingStopped() 672 void InspectorOverlay::profilingStopped()
669 { 673 {
670 --m_suspendCount; 674 --m_suspendCount;
671 } 675 }
672 676
673 void InspectorOverlay::pageLayoutInvalidated(bool resized) 677 void InspectorOverlay::pageLayoutInvalidated(bool resized)
674 { 678 {
675 if (resized && m_drawViewSize) { 679 if (resized && m_drawViewSize) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 781
778 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) 782 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node)
779 { 783 {
780 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node-> isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg ent) 784 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node-> isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg ent)
781 return; 785 return;
782 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen t, &overlayMainFrame()->script()); 786 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen t, &overlayMainFrame()->script());
783 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde n(true); 787 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde n(true);
784 } 788 }
785 789
786 } // namespace blink 790 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698