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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 | 629 |
630 void InspectorOverlay::evaluateInOverlay(const String& method, | 630 void InspectorOverlay::evaluateInOverlay(const String& method, |
631 const String& argument) { | 631 const String& argument) { |
632 ScriptForbiddenScope::AllowUserAgentScript allowScript; | 632 ScriptForbiddenScope::AllowUserAgentScript allowScript; |
633 std::unique_ptr<protocol::ListValue> command = protocol::ListValue::create(); | 633 std::unique_ptr<protocol::ListValue> command = protocol::ListValue::create(); |
634 command->pushValue(protocol::StringValue::create(method)); | 634 command->pushValue(protocol::StringValue::create(method)); |
635 command->pushValue(protocol::StringValue::create(argument)); | 635 command->pushValue(protocol::StringValue::create(argument)); |
636 toLocalFrame(overlayPage()->mainFrame()) | 636 toLocalFrame(overlayPage()->mainFrame()) |
637 ->script() | 637 ->script() |
638 .executeScriptInMainWorld( | 638 .executeScriptInMainWorld( |
639 "dispatch(" + command->toJSONString() + ")", | 639 "dispatch(" + command->serialize() + ")", |
640 ScriptController::ExecuteScriptWhenScriptsDisabled); | 640 ScriptController::ExecuteScriptWhenScriptsDisabled); |
641 } | 641 } |
642 | 642 |
643 void InspectorOverlay::evaluateInOverlay( | 643 void InspectorOverlay::evaluateInOverlay( |
644 const String& method, | 644 const String& method, |
645 std::unique_ptr<protocol::Value> argument) { | 645 std::unique_ptr<protocol::Value> argument) { |
646 ScriptForbiddenScope::AllowUserAgentScript allowScript; | 646 ScriptForbiddenScope::AllowUserAgentScript allowScript; |
647 std::unique_ptr<protocol::ListValue> command = protocol::ListValue::create(); | 647 std::unique_ptr<protocol::ListValue> command = protocol::ListValue::create(); |
648 command->pushValue(protocol::StringValue::create(method)); | 648 command->pushValue(protocol::StringValue::create(method)); |
649 command->pushValue(std::move(argument)); | 649 command->pushValue(std::move(argument)); |
650 toLocalFrame(overlayPage()->mainFrame()) | 650 toLocalFrame(overlayPage()->mainFrame()) |
651 ->script() | 651 ->script() |
652 .executeScriptInMainWorld( | 652 .executeScriptInMainWorld( |
653 "dispatch(" + command->toJSONString() + ")", | 653 "dispatch(" + command->serialize() + ")", |
654 ScriptController::ExecuteScriptWhenScriptsDisabled); | 654 ScriptController::ExecuteScriptWhenScriptsDisabled); |
655 } | 655 } |
656 | 656 |
657 String InspectorOverlay::evaluateInOverlayForTest(const String& script) { | 657 String InspectorOverlay::evaluateInOverlayForTest(const String& script) { |
658 ScriptForbiddenScope::AllowUserAgentScript allowScript; | 658 ScriptForbiddenScope::AllowUserAgentScript allowScript; |
659 v8::HandleScope handleScope(toIsolate(overlayMainFrame())); | 659 v8::HandleScope handleScope(toIsolate(overlayMainFrame())); |
660 v8::Local<v8::Value> string = | 660 v8::Local<v8::Value> string = |
661 toLocalFrame(overlayPage()->mainFrame()) | 661 toLocalFrame(overlayPage()->mainFrame()) |
662 ->script() | 662 ->script() |
663 .executeScriptInMainWorldAndReturnValue( | 663 .executeScriptInMainWorldAndReturnValue( |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 !node->isElementNode() || !node->ownerDocument()->isActive() || | 867 !node->isElementNode() || !node->ownerDocument()->isActive() || |
868 !m_cssAgent || !m_domAgent) | 868 !m_cssAgent || !m_domAgent) |
869 return; | 869 return; |
870 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgent, | 870 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgent, |
871 &overlayMainFrame()->script()); | 871 &overlayMainFrame()->script()); |
872 toChromeClientImpl(m_frameImpl->frame()->host()->chromeClient()) | 872 toChromeClientImpl(m_frameImpl->frame()->host()->chromeClient()) |
873 .setCursorOverridden(true); | 873 .setCursorOverridden(true); |
874 } | 874 } |
875 | 875 |
876 } // namespace blink | 876 } // namespace blink |
OLD | NEW |