| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file defines utility functions for working with html. | 5 // This file defines utility functions for working with html. |
| 6 | 6 |
| 7 #ifndef CHROME_FRAME_HTML_UTILS_H_ | 7 #ifndef CHROME_FRAME_HTML_UTILS_H_ |
| 8 #define CHROME_FRAME_HTML_UTILS_H_ | 8 #define CHROME_FRAME_HTML_UTILS_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 // Returns true if c can be found in quotes_, false otherwise | 103 // Returns true if c can be found in quotes_, false otherwise |
| 104 bool IsQuote(wchar_t c); | 104 bool IsQuote(wchar_t c); |
| 105 | 105 |
| 106 // Returns true if pos refers to the last character in an HTML comment in a | 106 // Returns true if pos refers to the last character in an HTML comment in a |
| 107 // string described by html_string, false otherwise. | 107 // string described by html_string, false otherwise. |
| 108 // For example with html_string describing <!-- foo> -->, pos must refer to | 108 // For example with html_string describing <!-- foo> -->, pos must refer to |
| 109 // the last > for this method to return true. | 109 // the last > for this method to return true. |
| 110 bool IsHTMLCommentClose(StringRange* html_string, StrPos pos); | 110 bool IsHTMLCommentClose(StringRange* html_string, StrPos pos); |
| 111 | 111 |
| 112 // Returns true if pos refers to the last character in the terminator of the |
| 113 // opening tag of a downlevel-hidden conditional comment in IE as per |
| 114 // http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx#syntax |
| 115 // For example with html_string describing <![if booga >wooga]>, pos must |
| 116 // refer to the last > for this method to return true. |
| 117 bool IsIEConditionalCommentClose(StringRange* html_string, StrPos pos); |
| 118 |
| 112 // We store a (CollapsedWhitespace'd) copy of the html data. | 119 // We store a (CollapsedWhitespace'd) copy of the html data. |
| 113 const std::wstring html_string_; | 120 const std::wstring html_string_; |
| 114 | 121 |
| 115 // Store the string of quote characters to avoid repeated construction. | 122 // Store the string of quote characters to avoid repeated construction. |
| 116 const std::wstring quotes_; | 123 const std::wstring quotes_; |
| 117 | 124 |
| 118 DISALLOW_COPY_AND_ASSIGN(HTMLScanner); | 125 DISALLOW_COPY_AND_ASSIGN(HTMLScanner); |
| 119 }; | 126 }; |
| 120 | 127 |
| 121 namespace http_utils { | 128 namespace http_utils { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 147 // may be multiple X-Frame-Options values specified; if there is one anywhere in | 154 // may be multiple X-Frame-Options values specified; if there is one anywhere in |
| 148 // the list with a value other than ALLOWALL, this returns true. | 155 // the list with a value other than ALLOWALL, this returns true. |
| 149 bool HasFrameBustingHeader(const std::string& http_headers); | 156 bool HasFrameBustingHeader(const std::string& http_headers); |
| 150 | 157 |
| 151 // Returns the header passed in from the headers list. | 158 // Returns the header passed in from the headers list. |
| 152 std::string GetHttpHeaderFromHeaderList(const std::string& header_name, | 159 std::string GetHttpHeaderFromHeaderList(const std::string& header_name, |
| 153 const std::string& headers); | 160 const std::string& headers); |
| 154 } // namespace http_utils | 161 } // namespace http_utils |
| 155 | 162 |
| 156 #endif // CHROME_FRAME_HTML_UTILS_H_ | 163 #endif // CHROME_FRAME_HTML_UTILS_H_ |
| OLD | NEW |