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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 m_state->setBoolean(PageAgentState::pageAgentShowScrollBottleneckRects, show
); | 746 m_state->setBoolean(PageAgentState::pageAgentShowScrollBottleneckRects, show
); |
747 m_client->setShowScrollBottleneckRects(show); | 747 m_client->setShowScrollBottleneckRects(show); |
748 } | 748 } |
749 | 749 |
750 void InspectorPageAgent::getScriptExecutionStatus(ErrorString*, PageCommandHandl
er::Result::Enum* status) | 750 void InspectorPageAgent::getScriptExecutionStatus(ErrorString*, PageCommandHandl
er::Result::Enum* status) |
751 { | 751 { |
752 bool disabledByScriptController = false; | 752 bool disabledByScriptController = false; |
753 bool disabledInSettings = false; | 753 bool disabledInSettings = false; |
754 Frame* frame = mainFrame(); | 754 Frame* frame = mainFrame(); |
755 if (frame) { | 755 if (frame) { |
756 disabledByScriptController = !frame->script()->canExecuteScripts(NotAbou
tToExecuteScript); | 756 disabledByScriptController = !frame->script().canExecuteScripts(NotAbout
ToExecuteScript); |
757 if (frame->settings()) | 757 if (frame->settings()) |
758 disabledInSettings = !frame->settings()->isScriptEnabled(); | 758 disabledInSettings = !frame->settings()->isScriptEnabled(); |
759 } | 759 } |
760 | 760 |
761 if (!disabledByScriptController) { | 761 if (!disabledByScriptController) { |
762 *status = PageCommandHandler::Result::Allowed; | 762 *status = PageCommandHandler::Result::Allowed; |
763 return; | 763 return; |
764 } | 764 } |
765 | 765 |
766 if (disabledInSettings) | 766 if (disabledInSettings) |
(...skipping 26 matching lines...) Expand all Loading... |
793 | 793 |
794 if (!m_frontend) | 794 if (!m_frontend) |
795 return; | 795 return; |
796 | 796 |
797 RefPtr<JSONObject> scripts = m_state->getObject(PageAgentState::pageAgentScr
iptsToEvaluateOnLoad); | 797 RefPtr<JSONObject> scripts = m_state->getObject(PageAgentState::pageAgentScr
iptsToEvaluateOnLoad); |
798 if (scripts) { | 798 if (scripts) { |
799 JSONObject::const_iterator end = scripts->end(); | 799 JSONObject::const_iterator end = scripts->end(); |
800 for (JSONObject::const_iterator it = scripts->begin(); it != end; ++it)
{ | 800 for (JSONObject::const_iterator it = scripts->begin(); it != end; ++it)
{ |
801 String scriptText; | 801 String scriptText; |
802 if (it->value->asString(&scriptText)) | 802 if (it->value->asString(&scriptText)) |
803 frame->script()->executeScriptInMainWorld(scriptText); | 803 frame->script().executeScriptInMainWorld(scriptText); |
804 } | 804 } |
805 } | 805 } |
806 if (!m_scriptToEvaluateOnLoadOnce.isEmpty()) | 806 if (!m_scriptToEvaluateOnLoadOnce.isEmpty()) |
807 frame->script()->executeScriptInMainWorld(m_scriptToEvaluateOnLoadOnce); | 807 frame->script().executeScriptInMainWorld(m_scriptToEvaluateOnLoadOnce); |
808 } | 808 } |
809 | 809 |
810 void InspectorPageAgent::domContentLoadedEventFired(Frame* frame) | 810 void InspectorPageAgent::domContentLoadedEventFired(Frame* frame) |
811 { | 811 { |
812 if (frame->page()->mainFrame() != frame) | 812 if (frame->page()->mainFrame() != frame) |
813 return; | 813 return; |
814 | 814 |
815 m_frontend->domContentEventFired(currentTime()); | 815 m_frontend->domContentEventFired(currentTime()); |
816 if (m_state->getBoolean(PageAgentState::forceCompositingMode)) | 816 if (m_state->getBoolean(PageAgentState::forceCompositingMode)) |
817 setForceCompositingMode(0, true); | 817 setForceCompositingMode(0, true); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 } | 1290 } |
1291 | 1291 |
1292 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) | 1292 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) |
1293 { | 1293 { |
1294 m_state->setBoolean(PageAgentState::showSizeOnResize, show); | 1294 m_state->setBoolean(PageAgentState::showSizeOnResize, show); |
1295 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; | 1295 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; |
1296 } | 1296 } |
1297 | 1297 |
1298 } // namespace WebCore | 1298 } // namespace WebCore |
1299 | 1299 |
OLD | NEW |