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

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

Issue 2716153003: Removed FrameHost::chromeClient() (Closed)
Patch Set: Small feedback 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 void InspectorOverlay::scheduleUpdate() { 388 void InspectorOverlay::scheduleUpdate() {
389 if (isEmpty()) { 389 if (isEmpty()) {
390 if (m_pageOverlay) 390 if (m_pageOverlay)
391 m_pageOverlay.reset(); 391 m_pageOverlay.reset();
392 return; 392 return;
393 } 393 }
394 m_needsUpdate = true; 394 m_needsUpdate = true;
395 FrameView* view = m_frameImpl->frameView(); 395 FrameView* view = m_frameImpl->frameView();
396 LocalFrame* frame = m_frameImpl->frame(); 396 LocalFrame* frame = m_frameImpl->frame();
397 if (view && frame) 397 if (view && frame)
398 frame->host()->chromeClient().scheduleAnimation(view); 398 frame->page()->chromeClient().scheduleAnimation(view);
399 } 399 }
400 400
401 void InspectorOverlay::rebuildOverlayPage() { 401 void InspectorOverlay::rebuildOverlayPage() {
402 FrameView* view = m_frameImpl->frameView(); 402 FrameView* view = m_frameImpl->frameView();
403 LocalFrame* frame = m_frameImpl->frame(); 403 LocalFrame* frame = m_frameImpl->frame();
404 if (!view || !frame) 404 if (!view || !frame)
405 return; 405 return;
406 406
407 IntRect visibleRectInDocument = 407 IntRect visibleRectInDocument =
408 view->getScrollableArea()->visibleContentRect(); 408 view->getScrollableArea()->visibleContentRect();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 488
489 void InspectorOverlay::drawViewSize() { 489 void InspectorOverlay::drawViewSize() {
490 if (m_resizeTimerActive && m_drawViewSize) 490 if (m_resizeTimerActive && m_drawViewSize)
491 evaluateInOverlay("drawViewSize", ""); 491 evaluateInOverlay("drawViewSize", "");
492 } 492 }
493 493
494 float InspectorOverlay::windowToViewportScale() const { 494 float InspectorOverlay::windowToViewportScale() const {
495 LocalFrame* frame = m_frameImpl->frame(); 495 LocalFrame* frame = m_frameImpl->frame();
496 if (!frame) 496 if (!frame)
497 return 1.0f; 497 return 1.0f;
498 return frame->host()->chromeClient().windowToViewportScalar(1.0f); 498 return frame->page()->chromeClient().windowToViewportScalar(1.0f);
499 } 499 }
500 500
501 Page* InspectorOverlay::overlayPage() { 501 Page* InspectorOverlay::overlayPage() {
502 if (m_overlayPage) 502 if (m_overlayPage)
503 return m_overlayPage.get(); 503 return m_overlayPage.get();
504 504
505 ScriptForbiddenScope::AllowUserAgentScript allowScript; 505 ScriptForbiddenScope::AllowUserAgentScript allowScript;
506 506
507 DEFINE_STATIC_LOCAL(LocalFrameClient, dummyLocalFrameClient, 507 DEFINE_STATIC_LOCAL(LocalFrameClient, dummyLocalFrameClient,
508 (EmptyLocalFrameClient::create())); 508 (EmptyLocalFrameClient::create()));
509 Page::PageClients pageClients; 509 Page::PageClients pageClients;
510 fillWithEmptyClients(pageClients); 510 fillWithEmptyClients(pageClients);
511 DCHECK(!m_overlayChromeClient); 511 DCHECK(!m_overlayChromeClient);
512 m_overlayChromeClient = InspectorOverlayChromeClient::create( 512 m_overlayChromeClient = InspectorOverlayChromeClient::create(
513 m_frameImpl->frame()->host()->chromeClient(), *this); 513 m_frameImpl->frame()->page()->chromeClient(), *this);
514 pageClients.chromeClient = m_overlayChromeClient.get(); 514 pageClients.chromeClient = m_overlayChromeClient.get();
515 m_overlayPage = Page::create(pageClients); 515 m_overlayPage = Page::create(pageClients);
516 516
517 Settings& settings = m_frameImpl->frame()->page()->settings(); 517 Settings& settings = m_frameImpl->frame()->page()->settings();
518 Settings& overlaySettings = m_overlayPage->settings(); 518 Settings& overlaySettings = m_overlayPage->settings();
519 519
520 overlaySettings.genericFontFamilySettings().updateStandard( 520 overlaySettings.genericFontFamilySettings().updateStandard(
521 settings.genericFontFamilySettings().standard()); 521 settings.genericFontFamilySettings().standard());
522 overlaySettings.genericFontFamilySettings().updateSerif( 522 overlaySettings.genericFontFamilySettings().updateSerif(
523 settings.genericFontFamilySettings().serif()); 523 settings.genericFontFamilySettings().serif());
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 const IntPoint& documentScrollOffset) { 587 const IntPoint& documentScrollOffset) {
588 std::unique_ptr<protocol::DictionaryValue> resetData = 588 std::unique_ptr<protocol::DictionaryValue> resetData =
589 protocol::DictionaryValue::create(); 589 protocol::DictionaryValue::create();
590 resetData->setDouble( 590 resetData->setDouble(
591 "deviceScaleFactor", 591 "deviceScaleFactor",
592 m_frameImpl->frame()->host()->deviceScaleFactorDeprecated()); 592 m_frameImpl->frame()->host()->deviceScaleFactorDeprecated());
593 resetData->setDouble("pageScaleFactor", 593 resetData->setDouble("pageScaleFactor",
594 m_frameImpl->frame()->host()->visualViewport().scale()); 594 m_frameImpl->frame()->host()->visualViewport().scale());
595 595
596 IntRect viewportInScreen = 596 IntRect viewportInScreen =
597 m_frameImpl->frame()->host()->chromeClient().viewportToScreen( 597 m_frameImpl->frame()->page()->chromeClient().viewportToScreen(
598 IntRect(IntPoint(), viewportSize), m_frameImpl->frame()->view()); 598 IntRect(IntPoint(), viewportSize), m_frameImpl->frame()->view());
599 resetData->setObject("viewportSize", 599 resetData->setObject("viewportSize",
600 buildObjectForSize(viewportInScreen.size())); 600 buildObjectForSize(viewportInScreen.size()));
601 601
602 // The zoom factor in the overlay frame already has been multiplied by the 602 // The zoom factor in the overlay frame already has been multiplied by the
603 // window to viewport scale (aka device scale factor), so cancel it. 603 // window to viewport scale (aka device scale factor), so cancel it.
604 resetData->setDouble( 604 resetData->setDouble(
605 "pageZoomFactor", 605 "pageZoomFactor",
606 m_frameImpl->frame()->pageZoomFactor() / windowToViewportScale()); 606 m_frameImpl->frame()->pageZoomFactor() / windowToViewportScale());
607 607
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 bool InspectorOverlay::shouldSearchForNode() { 787 bool InspectorOverlay::shouldSearchForNode() {
788 return m_inspectMode != InspectorDOMAgent::NotSearching; 788 return m_inspectMode != InspectorDOMAgent::NotSearching;
789 } 789 }
790 790
791 void InspectorOverlay::inspect(Node* node) { 791 void InspectorOverlay::inspect(Node* node) {
792 if (m_domAgent) 792 if (m_domAgent)
793 m_domAgent->inspect(node); 793 m_domAgent->inspect(node);
794 } 794 }
795 795
796 } // namespace blink 796 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698