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

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

Issue 2730573003: Moved FrameHost::m_visualViewport to Page (Closed)
Patch Set: Fixed some compile errors on mac and android Created 3 years, 9 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
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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 } 404 }
405 405
406 void InspectorOverlay::rebuildOverlayPage() { 406 void InspectorOverlay::rebuildOverlayPage() {
407 FrameView* view = m_frameImpl->frameView(); 407 FrameView* view = m_frameImpl->frameView();
408 LocalFrame* frame = m_frameImpl->frame(); 408 LocalFrame* frame = m_frameImpl->frame();
409 if (!view || !frame) 409 if (!view || !frame)
410 return; 410 return;
411 411
412 IntRect visibleRectInDocument = 412 IntRect visibleRectInDocument =
413 view->getScrollableArea()->visibleContentRect(); 413 view->getScrollableArea()->visibleContentRect();
414 IntSize viewportSize = frame->host()->visualViewport().size(); 414 IntSize viewportSize = frame->page()->visualViewport().size();
415 overlayMainFrame()->view()->resize(viewportSize); 415 overlayMainFrame()->view()->resize(viewportSize);
416 overlayPage()->frameHost().visualViewport().setSize(viewportSize); 416 overlayPage()->visualViewport().setSize(viewportSize);
417 overlayMainFrame()->setPageZoomFactor(windowToViewportScale()); 417 overlayMainFrame()->setPageZoomFactor(windowToViewportScale());
418 418
419 reset(viewportSize, visibleRectInDocument.location()); 419 reset(viewportSize, visibleRectInDocument.location());
420 420
421 if (m_showReloadingBlanket) { 421 if (m_showReloadingBlanket) {
422 evaluateInOverlay("showReloadingBlanket", ""); 422 evaluateInOverlay("showReloadingBlanket", "");
423 return; 423 return;
424 } 424 }
425 drawNodeHighlight(); 425 drawNodeHighlight();
426 drawQuadHighlight(); 426 drawQuadHighlight();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 } 589 }
590 590
591 void InspectorOverlay::reset(const IntSize& viewportSize, 591 void InspectorOverlay::reset(const IntSize& viewportSize,
592 const IntPoint& documentScrollOffset) { 592 const IntPoint& documentScrollOffset) {
593 std::unique_ptr<protocol::DictionaryValue> resetData = 593 std::unique_ptr<protocol::DictionaryValue> resetData =
594 protocol::DictionaryValue::create(); 594 protocol::DictionaryValue::create();
595 resetData->setDouble( 595 resetData->setDouble(
596 "deviceScaleFactor", 596 "deviceScaleFactor",
597 m_frameImpl->frame()->page()->deviceScaleFactorDeprecated()); 597 m_frameImpl->frame()->page()->deviceScaleFactorDeprecated());
598 resetData->setDouble("pageScaleFactor", 598 resetData->setDouble("pageScaleFactor",
599 m_frameImpl->frame()->host()->visualViewport().scale()); 599 m_frameImpl->frame()->page()->visualViewport().scale());
600 600
601 IntRect viewportInScreen = 601 IntRect viewportInScreen =
602 m_frameImpl->frame()->page()->chromeClient().viewportToScreen( 602 m_frameImpl->frame()->page()->chromeClient().viewportToScreen(
603 IntRect(IntPoint(), viewportSize), m_frameImpl->frame()->view()); 603 IntRect(IntPoint(), viewportSize), m_frameImpl->frame()->view());
604 resetData->setObject("viewportSize", 604 resetData->setObject("viewportSize",
605 buildObjectForSize(viewportInScreen.size())); 605 buildObjectForSize(viewportInScreen.size()));
606 606
607 // The zoom factor in the overlay frame already has been multiplied by the 607 // The zoom factor in the overlay frame already has been multiplied by the
608 // window to viewport scale (aka device scale factor), so cancel it. 608 // window to viewport scale (aka device scale factor), so cancel it.
609 resetData->setDouble( 609 resetData->setDouble(
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 bool InspectorOverlay::shouldSearchForNode() { 803 bool InspectorOverlay::shouldSearchForNode() {
804 return m_inspectMode != InspectorDOMAgent::NotSearching; 804 return m_inspectMode != InspectorDOMAgent::NotSearching;
805 } 805 }
806 806
807 void InspectorOverlay::inspect(Node* node) { 807 void InspectorOverlay::inspect(Node* node) {
808 if (m_domAgent) 808 if (m_domAgent)
809 m_domAgent->inspect(node); 809 m_domAgent->inspect(node);
810 } 810 }
811 811
812 } // namespace blink 812 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ExternalPopupMenuTest.cpp ('k') | third_party/WebKit/Source/web/PageOverlay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698