| 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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 // and we don't need "frame" at all. | 956 // and we don't need "frame" at all. |
| 957 if (loader->frame() == m_page->mainFrame()) { | 957 if (loader->frame() == m_page->mainFrame()) { |
| 958 m_scriptToEvaluateOnLoadOnce = m_pendingScriptToEvaluateOnLoadOnce; | 958 m_scriptToEvaluateOnLoadOnce = m_pendingScriptToEvaluateOnLoadOnce; |
| 959 m_scriptPreprocessorSource = m_pendingScriptPreprocessor; | 959 m_scriptPreprocessorSource = m_pendingScriptPreprocessor; |
| 960 m_pendingScriptToEvaluateOnLoadOnce = String(); | 960 m_pendingScriptToEvaluateOnLoadOnce = String(); |
| 961 m_pendingScriptPreprocessor = String(); | 961 m_pendingScriptPreprocessor = String(); |
| 962 if (m_inspectorResourceContentLoader) | 962 if (m_inspectorResourceContentLoader) |
| 963 m_inspectorResourceContentLoader->stop(); | 963 m_inspectorResourceContentLoader->stop(); |
| 964 } | 964 } |
| 965 m_frontend->frameNavigated(buildObjectForFrame(loader->frame())); | 965 m_frontend->frameNavigated(buildObjectForFrame(loader->frame())); |
| 966 viewportChanged(); |
| 966 } | 967 } |
| 967 | 968 |
| 968 void InspectorPageAgent::frameAttachedToParent(LocalFrame* frame) | 969 void InspectorPageAgent::frameAttachedToParent(LocalFrame* frame) |
| 969 { | 970 { |
| 970 Frame* parentFrame = frame->tree().parent(); | 971 Frame* parentFrame = frame->tree().parent(); |
| 971 if (!parentFrame->isLocalFrame()) | 972 if (!parentFrame->isLocalFrame()) |
| 972 parentFrame = 0; | 973 parentFrame = 0; |
| 973 m_frontend->frameAttached(frameId(frame), frameId(toLocalFrame(parentFrame))
); | 974 m_frontend->frameAttached(frameId(frame), frameId(toLocalFrame(parentFrame))
); |
| 974 } | 975 } |
| 975 | 976 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 LayoutRect inflatedRect(rect); | 1131 LayoutRect inflatedRect(rect); |
| 1131 inflatedRect.inflate(-1); | 1132 inflatedRect.inflate(-1); |
| 1132 m_overlay->drawOutline(context, inflatedRect, colors[colorSelector++ % WTF_A
RRAY_LENGTH(colors)]); | 1133 m_overlay->drawOutline(context, inflatedRect, colors[colorSelector++ % WTF_A
RRAY_LENGTH(colors)]); |
| 1133 } | 1134 } |
| 1134 | 1135 |
| 1135 void InspectorPageAgent::didLayout(RenderObject*) | 1136 void InspectorPageAgent::didLayout(RenderObject*) |
| 1136 { | 1137 { |
| 1137 if (!m_enabled) | 1138 if (!m_enabled) |
| 1138 return; | 1139 return; |
| 1139 m_overlay->update(); | 1140 m_overlay->update(); |
| 1141 viewportChanged(); |
| 1140 } | 1142 } |
| 1141 | 1143 |
| 1142 void InspectorPageAgent::didScroll() | 1144 void InspectorPageAgent::didScroll() |
| 1143 { | 1145 { |
| 1144 if (m_enabled) | 1146 if (m_enabled) |
| 1145 m_overlay->update(); | 1147 m_overlay->update(); |
| 1148 viewportChanged(); |
| 1149 } |
| 1150 |
| 1151 void InspectorPageAgent::viewportChanged() |
| 1152 { |
| 1153 if (!m_enabled) |
| 1154 return; |
| 1155 IntSize contentsSize = m_page->deprecatedLocalMainFrame()->view()->contentsS
ize(); |
| 1156 IntRect viewRect = m_page->deprecatedLocalMainFrame()->view()->visibleConten
tRect(); |
| 1157 RefPtr<TypeBuilder::Page::Viewport> viewport = TypeBuilder::Page::Viewport::
create() |
| 1158 .setScrollX(viewRect.x()) |
| 1159 .setScrollY(viewRect.y()) |
| 1160 .setContentsWidth(contentsSize.width()) |
| 1161 .setContentsHeight(contentsSize.height()) |
| 1162 .setPageScaleFactor(m_page->pageScaleFactor()); |
| 1163 m_frontend->viewportChanged(viewport); |
| 1146 } | 1164 } |
| 1147 | 1165 |
| 1148 void InspectorPageAgent::didResizeMainFrame() | 1166 void InspectorPageAgent::didResizeMainFrame() |
| 1149 { | 1167 { |
| 1150 #if !OS(ANDROID) | 1168 #if !OS(ANDROID) |
| 1151 if (m_enabled && m_state->getBoolean(PageAgentState::showSizeOnResize)) | 1169 if (m_enabled && m_state->getBoolean(PageAgentState::showSizeOnResize)) |
| 1152 m_overlay->showAndHideViewSize(m_state->getBoolean(PageAgentState::showG
ridOnResize)); | 1170 m_overlay->showAndHideViewSize(m_state->getBoolean(PageAgentState::showG
ridOnResize)); |
| 1153 #endif | 1171 #endif |
| 1154 m_frontend->frameResized(); | 1172 m_frontend->frameResized(); |
| 1173 viewportChanged(); |
| 1155 } | 1174 } |
| 1156 | 1175 |
| 1157 void InspectorPageAgent::didRecalculateStyle(int) | 1176 void InspectorPageAgent::didRecalculateStyle(int) |
| 1158 { | 1177 { |
| 1159 if (m_enabled) | 1178 if (m_enabled) |
| 1160 m_overlay->update(); | 1179 m_overlay->update(); |
| 1161 } | 1180 } |
| 1162 | 1181 |
| 1182 void InspectorPageAgent::deviceOrPageScaleFactorChanged() |
| 1183 { |
| 1184 if (m_enabled) |
| 1185 m_overlay->update(); |
| 1186 viewportChanged(); |
| 1187 } |
| 1188 |
| 1163 void InspectorPageAgent::scriptsEnabled(bool isEnabled) | 1189 void InspectorPageAgent::scriptsEnabled(bool isEnabled) |
| 1164 { | 1190 { |
| 1165 if (m_ignoreScriptsEnabledNotification) | 1191 if (m_ignoreScriptsEnabledNotification) |
| 1166 return; | 1192 return; |
| 1167 | 1193 |
| 1168 m_frontend->scriptsEnabled(isEnabled); | 1194 m_frontend->scriptsEnabled(isEnabled); |
| 1169 } | 1195 } |
| 1170 | 1196 |
| 1171 PassRefPtr<TypeBuilder::Page::Frame> InspectorPageAgent::buildObjectForFrame(Loc
alFrame* frame) | 1197 PassRefPtr<TypeBuilder::Page::Frame> InspectorPageAgent::buildObjectForFrame(Loc
alFrame* frame) |
| 1172 { | 1198 { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con
tent) | 1413 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con
tent) |
| 1388 { | 1414 { |
| 1389 if (!m_editedResourceContent.contains(url)) | 1415 if (!m_editedResourceContent.contains(url)) |
| 1390 return false; | 1416 return false; |
| 1391 *content = m_editedResourceContent.get(url); | 1417 *content = m_editedResourceContent.get(url); |
| 1392 return true; | 1418 return true; |
| 1393 } | 1419 } |
| 1394 | 1420 |
| 1395 } // namespace WebCore | 1421 } // namespace WebCore |
| 1396 | 1422 |
| OLD | NEW |