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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 517 |
518 LocalFrame* InspectorOverlay::overlayMainFrame() | 518 LocalFrame* InspectorOverlay::overlayMainFrame() |
519 { | 519 { |
520 return toLocalFrame(overlayPage()->mainFrame()); | 520 return toLocalFrame(overlayPage()->mainFrame()); |
521 } | 521 } |
522 | 522 |
523 void InspectorOverlay::reset(const IntSize& viewportSize, const IntPoint& docume
ntScrollOffset) | 523 void InspectorOverlay::reset(const IntSize& viewportSize, const IntPoint& docume
ntScrollOffset) |
524 { | 524 { |
525 RefPtr<JSONObject> resetData = JSONObject::create(); | 525 RefPtr<JSONObject> resetData = JSONObject::create(); |
526 resetData->setNumber("deviceScaleFactor", m_webViewImpl->page()->deviceScale
Factor()); | 526 resetData->setNumber("deviceScaleFactor", m_webViewImpl->page()->deviceScale
Factor()); |
527 resetData->setNumber("pageScaleFactor", m_webViewImpl->page()->pageScaleFact
or()); | |
528 resetData->setObject("viewportSize", buildObjectForSize(viewportSize)); | 527 resetData->setObject("viewportSize", buildObjectForSize(viewportSize)); |
529 resetData->setNumber("pageZoomFactor", m_webViewImpl->mainFrameImpl()->frame
()->pageZoomFactor()); | 528 resetData->setNumber("pageZoomFactor", m_webViewImpl->mainFrameImpl()->frame
()->pageZoomFactor()); |
530 resetData->setNumber("scrollX", documentScrollOffset.x()); | 529 resetData->setNumber("scrollX", documentScrollOffset.x()); |
531 resetData->setNumber("scrollY", documentScrollOffset.y()); | 530 resetData->setNumber("scrollY", documentScrollOffset.y()); |
532 evaluateInOverlay("reset", resetData.release()); | 531 evaluateInOverlay("reset", resetData.release()); |
533 } | 532 } |
534 | 533 |
535 void InspectorOverlay::evaluateInOverlay(const String& method, const String& arg
ument) | 534 void InspectorOverlay::evaluateInOverlay(const String& method, const String& arg
ument) |
536 { | 535 { |
537 ScriptForbiddenScope::AllowUserAgentScript allowScript; | 536 ScriptForbiddenScope::AllowUserAgentScript allowScript; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 | 746 |
748 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) | 747 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) |
749 { | 748 { |
750 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive()) | 749 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive()) |
751 return; | 750 return; |
752 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); | 751 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); |
753 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); | 752 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); |
754 } | 753 } |
755 | 754 |
756 } // namespace blink | 755 } // namespace blink |
OLD | NEW |