| 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 27 matching lines...) Expand all Loading... |
| 38 #include "bindings/v8/ScriptObject.h" | 38 #include "bindings/v8/ScriptObject.h" |
| 39 #include "core/dom/DOMImplementation.h" | 39 #include "core/dom/DOMImplementation.h" |
| 40 #include "core/dom/DeviceOrientationController.h" | 40 #include "core/dom/DeviceOrientationController.h" |
| 41 #include "core/dom/Document.h" | 41 #include "core/dom/Document.h" |
| 42 #include "core/dom/UserGestureIndicator.h" | 42 #include "core/dom/UserGestureIndicator.h" |
| 43 #include "core/html/HTMLFrameOwnerElement.h" | 43 #include "core/html/HTMLFrameOwnerElement.h" |
| 44 #include "core/inspector/ContentSearchUtils.h" | 44 #include "core/inspector/ContentSearchUtils.h" |
| 45 #include "core/inspector/DOMPatchSupport.h" | 45 #include "core/inspector/DOMPatchSupport.h" |
| 46 #include "core/inspector/IdentifiersFactory.h" | 46 #include "core/inspector/IdentifiersFactory.h" |
| 47 #include "core/inspector/InjectedScriptManager.h" | 47 #include "core/inspector/InjectedScriptManager.h" |
| 48 #include "core/inspector/InspectorAgent.h" | |
| 49 #include "core/inspector/InspectorClient.h" | 48 #include "core/inspector/InspectorClient.h" |
| 50 #include "core/inspector/InspectorInstrumentation.h" | 49 #include "core/inspector/InspectorInstrumentation.h" |
| 51 #include "core/inspector/InspectorOverlay.h" | 50 #include "core/inspector/InspectorOverlay.h" |
| 52 #include "core/inspector/InspectorState.h" | 51 #include "core/inspector/InspectorState.h" |
| 53 #include "core/inspector/InspectorValues.h" | 52 #include "core/inspector/InspectorValues.h" |
| 54 #include "core/inspector/InstrumentingAgents.h" | 53 #include "core/inspector/InstrumentingAgents.h" |
| 55 #include "core/loader/CookieJar.h" | 54 #include "core/loader/CookieJar.h" |
| 56 #include "core/loader/DocumentLoader.h" | 55 #include "core/loader/DocumentLoader.h" |
| 57 #include "core/loader/FrameLoader.h" | 56 #include "core/loader/FrameLoader.h" |
| 58 #include "core/loader/TextResourceDecoder.h" | 57 #include "core/loader/TextResourceDecoder.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 bool InspectorPageAgent::dataContent(const char* data, unsigned size, const Stri
ng& textEncodingName, bool withBase64Encode, String* result) | 221 bool InspectorPageAgent::dataContent(const char* data, unsigned size, const Stri
ng& textEncodingName, bool withBase64Encode, String* result) |
| 223 { | 222 { |
| 224 if (withBase64Encode) { | 223 if (withBase64Encode) { |
| 225 *result = base64Encode(data, size); | 224 *result = base64Encode(data, size); |
| 226 return true; | 225 return true; |
| 227 } | 226 } |
| 228 | 227 |
| 229 return decodeBuffer(data, size, textEncodingName, result); | 228 return decodeBuffer(data, size, textEncodingName, result); |
| 230 } | 229 } |
| 231 | 230 |
| 232 PassOwnPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* i
nstrumentingAgents, Page* page, InspectorAgent* inspectorAgent, InspectorComposi
teState* state, InjectedScriptManager* injectedScriptManager, InspectorClient* c
lient, InspectorOverlay* overlay) | 231 PassOwnPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* i
nstrumentingAgents, Page* page, InspectorCompositeState* state, InjectedScriptMa
nager* injectedScriptManager, InspectorClient* client, InspectorOverlay* overlay
) |
| 233 { | 232 { |
| 234 return adoptPtr(new InspectorPageAgent(instrumentingAgents, page, inspectorA
gent, state, injectedScriptManager, client, overlay)); | 233 return adoptPtr(new InspectorPageAgent(instrumentingAgents, page, state, inj
ectedScriptManager, client, overlay)); |
| 235 } | 234 } |
| 236 | 235 |
| 237 // static | 236 // static |
| 238 void InspectorPageAgent::resourceContent(ErrorString* errorString, Frame* frame,
const KURL& url, String* result, bool* base64Encoded) | 237 void InspectorPageAgent::resourceContent(ErrorString* errorString, Frame* frame,
const KURL& url, String* result, bool* base64Encoded) |
| 239 { | 238 { |
| 240 DocumentLoader* loader = assertDocumentLoader(errorString, frame); | 239 DocumentLoader* loader = assertDocumentLoader(errorString, frame); |
| 241 if (!loader) | 240 if (!loader) |
| 242 return; | 241 return; |
| 243 if (!cachedResourceContent(cachedResource(frame, url), result, base64Encoded
)) | 242 if (!cachedResourceContent(cachedResource(frame, url), result, base64Encoded
)) |
| 244 *errorString = "No resource with given URL found"; | 243 *errorString = "No resource with given URL found"; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 break; | 295 break; |
| 297 } | 296 } |
| 298 return InspectorPageAgent::OtherResource; | 297 return InspectorPageAgent::OtherResource; |
| 299 } | 298 } |
| 300 | 299 |
| 301 TypeBuilder::Page::ResourceType::Enum InspectorPageAgent::cachedResourceTypeJson
(const CachedResource& cachedResource) | 300 TypeBuilder::Page::ResourceType::Enum InspectorPageAgent::cachedResourceTypeJson
(const CachedResource& cachedResource) |
| 302 { | 301 { |
| 303 return resourceTypeJson(cachedResourceType(cachedResource)); | 302 return resourceTypeJson(cachedResourceType(cachedResource)); |
| 304 } | 303 } |
| 305 | 304 |
| 306 InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents,
Page* page, InspectorAgent* inspectorAgent, InspectorCompositeState* inspectorS
tate, InjectedScriptManager* injectedScriptManager, InspectorClient* client, Ins
pectorOverlay* overlay) | 305 InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents,
Page* page, InspectorCompositeState* inspectorState, InjectedScriptManager* inj
ectedScriptManager, InspectorClient* client, InspectorOverlay* overlay) |
| 307 : InspectorBaseAgent<InspectorPageAgent>("Page", instrumentingAgents, inspec
torState) | 306 : InspectorBaseAgent<InspectorPageAgent>("Page", instrumentingAgents, inspec
torState) |
| 308 , m_page(page) | 307 , m_page(page) |
| 309 , m_inspectorAgent(inspectorAgent) | |
| 310 , m_injectedScriptManager(injectedScriptManager) | 308 , m_injectedScriptManager(injectedScriptManager) |
| 311 , m_client(client) | 309 , m_client(client) |
| 312 , m_frontend(0) | 310 , m_frontend(0) |
| 313 , m_overlay(overlay) | 311 , m_overlay(overlay) |
| 314 , m_lastScriptIdentifier(0) | 312 , m_lastScriptIdentifier(0) |
| 315 , m_enabled(false) | 313 , m_enabled(false) |
| 316 , m_isFirstLayoutAfterOnLoad(false) | 314 , m_isFirstLayoutAfterOnLoad(false) |
| 317 , m_geolocationOverridden(false) | 315 , m_geolocationOverridden(false) |
| 318 , m_ignoreScriptsEnabledNotification(false) | 316 , m_ignoreScriptsEnabledNotification(false) |
| 319 , m_didForceCompositingMode(false) | 317 , m_didForceCompositingMode(false) |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 } | 1247 } |
| 1250 | 1248 |
| 1251 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) | 1249 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) |
| 1252 { | 1250 { |
| 1253 m_state->setBoolean(PageAgentState::showSizeOnResize, show); | 1251 m_state->setBoolean(PageAgentState::showSizeOnResize, show); |
| 1254 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; | 1252 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; |
| 1255 } | 1253 } |
| 1256 | 1254 |
| 1257 } // namespace WebCore | 1255 } // namespace WebCore |
| 1258 | 1256 |
| OLD | NEW |