| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // This class is used to serialize frame's contents back to text (typically | 61 // This class is used to serialize frame's contents back to text (typically |
| 62 // HTML). It serializes frame's document and resources such as images and CSS | 62 // HTML). It serializes frame's document and resources such as images and CSS |
| 63 // stylesheets. | 63 // stylesheets. |
| 64 class CORE_EXPORT FrameSerializer final { | 64 class CORE_EXPORT FrameSerializer final { |
| 65 STACK_ALLOCATED(); | 65 STACK_ALLOCATED(); |
| 66 | 66 |
| 67 public: | 67 public: |
| 68 class Delegate { | 68 class Delegate { |
| 69 public: | 69 public: |
| 70 // Controls whether HTML serialization should skip the given attribute. | 70 // Controls whether HTML serialization should skip the given attribute. |
| 71 virtual bool shouldIgnoreAttribute(const Attribute&) { return false; } | 71 virtual bool shouldIgnoreAttribute(const Element&, const Attribute&) { |
| 72 return false; |
| 73 } |
| 72 | 74 |
| 73 // Method allowing the Delegate control which URLs are written into the | 75 // Method allowing the Delegate control which URLs are written into the |
| 74 // generated html document. | 76 // generated html document. |
| 75 // | 77 // |
| 76 // When URL of the element needs to be rewritten, this method should | 78 // When URL of the element needs to be rewritten, this method should |
| 77 // return true and populate |rewrittenLink| with a desired value of the | 79 // return true and populate |rewrittenLink| with a desired value of the |
| 78 // html attribute value to be used in place of the original link. | 80 // html attribute value to be used in place of the original link. |
| 79 // (i.e. in place of img.src or iframe.src or object.data). | 81 // (i.e. in place of img.src or iframe.src or object.data). |
| 80 // | 82 // |
| 81 // If no link rewriting is desired, this method should return false. | 83 // If no link rewriting is desired, this method should return false. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 HashSet<KURL> m_resourceURLs; | 132 HashSet<KURL> m_resourceURLs; |
| 131 | 133 |
| 132 bool m_isSerializingCss; | 134 bool m_isSerializingCss; |
| 133 | 135 |
| 134 Delegate& m_delegate; | 136 Delegate& m_delegate; |
| 135 }; | 137 }; |
| 136 | 138 |
| 137 } // namespace blink | 139 } // namespace blink |
| 138 | 140 |
| 139 #endif // FrameSerializer_h | 141 #endif // FrameSerializer_h |
| OLD | NEW |