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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 static bool hasTextContent(Resource* cachedResource) | 159 static bool hasTextContent(Resource* cachedResource) |
160 { | 160 { |
161 InspectorPageAgent::ResourceType type = InspectorPageAgent::cachedResourceTy
pe(*cachedResource); | 161 InspectorPageAgent::ResourceType type = InspectorPageAgent::cachedResourceTy
pe(*cachedResource); |
162 return type == InspectorPageAgent::DocumentResource || type == InspectorPage
Agent::StylesheetResource || type == InspectorPageAgent::ScriptResource || type
== InspectorPageAgent::XHRResource; | 162 return type == InspectorPageAgent::DocumentResource || type == InspectorPage
Agent::StylesheetResource || type == InspectorPageAgent::ScriptResource || type
== InspectorPageAgent::XHRResource; |
163 } | 163 } |
164 | 164 |
165 static PassOwnPtr<TextResourceDecoder> createXHRTextDecoder(const String& mimeTy
pe, const String& textEncodingName) | 165 static PassOwnPtr<TextResourceDecoder> createXHRTextDecoder(const String& mimeTy
pe, const String& textEncodingName) |
166 { | 166 { |
167 if (!textEncodingName.isEmpty()) | 167 if (!textEncodingName.isEmpty()) |
168 return TextResourceDecoder::create("text/plain", textEncodingName); | 168 return TextResourceDecoder::create("text/plain", textEncodingName); |
169 if (DOMImplementation::isXMLMIMEType(mimeType.lower())) { | 169 if (DOMImplementation::isXMLMIMEType(mimeType)) { |
170 OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("appli
cation/xml"); | 170 OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("appli
cation/xml"); |
171 decoder->useLenientXMLDecoding(); | 171 decoder->useLenientXMLDecoding(); |
172 return decoder.release(); | 172 return decoder.release(); |
173 } | 173 } |
174 if (equalIgnoringCase(mimeType, "text/html")) | 174 if (equalIgnoringCase(mimeType, "text/html")) |
175 return TextResourceDecoder::create("text/html", "UTF-8"); | 175 return TextResourceDecoder::create("text/html", "UTF-8"); |
176 return TextResourceDecoder::create("text/plain", "UTF-8"); | 176 return TextResourceDecoder::create("text/plain", "UTF-8"); |
177 } | 177 } |
178 | 178 |
179 bool InspectorPageAgent::cachedResourceContent(Resource* cachedResource, String*
result, bool* base64Encoded) | 179 bool InspectorPageAgent::cachedResourceContent(Resource* cachedResource, String*
result, bool* base64Encoded) |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 } | 1271 } |
1272 | 1272 |
1273 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) | 1273 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) |
1274 { | 1274 { |
1275 m_state->setBoolean(PageAgentState::showSizeOnResize, show); | 1275 m_state->setBoolean(PageAgentState::showSizeOnResize, show); |
1276 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; | 1276 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; |
1277 } | 1277 } |
1278 | 1278 |
1279 } // namespace WebCore | 1279 } // namespace WebCore |
1280 | 1280 |
OLD | NEW |