| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef WEBKIT_GLUE_WEBKIT_GLUE_H_ | 5 #ifndef WEBKIT_GLUE_WEBKIT_GLUE_H_ |
| 6 #define WEBKIT_GLUE_WEBKIT_GLUE_H_ | 6 #define WEBKIT_GLUE_WEBKIT_GLUE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void PrefetchDns(const std::string& hostname); | 155 void PrefetchDns(const std::string& hostname); |
| 156 | 156 |
| 157 // This function is called to request a prefetch of the entire URL, loading it | 157 // This function is called to request a prefetch of the entire URL, loading it |
| 158 // into our cache for (expected) future needs. The given URL may NOT be in | 158 // into our cache for (expected) future needs. The given URL may NOT be in |
| 159 // canonical form and it will NOT be null-terminated; use the length instead. | 159 // canonical form and it will NOT be null-terminated; use the length instead. |
| 160 void PrecacheUrl(const char16* url, int url_length); | 160 void PrecacheUrl(const char16* url, int url_length); |
| 161 | 161 |
| 162 // This function is called to add a line to the application's log file. | 162 // This function is called to add a line to the application's log file. |
| 163 void AppendToLog(const char* filename, int line, const char* message); | 163 void AppendToLog(const char* filename, int line, const char* message); |
| 164 | 164 |
| 165 // Get the mime type (if any) that is associated with the given file extension. | |
| 166 // Returns true if a corresponding mime type exists. | |
| 167 bool GetMimeTypeFromExtension(const FilePath::StringType& ext, | |
| 168 std::string* mime_type); | |
| 169 | |
| 170 // Get the mime type (if any) that is associated with the given file. | |
| 171 // Returns true if a corresponding mime type exists. | |
| 172 bool GetMimeTypeFromFile(const FilePath& file_path, std::string* mime_type); | |
| 173 | |
| 174 // Get the preferred extension (if any) associated with the given mime type. | |
| 175 // Returns true if a corresponding file extension exists. The extension does | |
| 176 // not include a prefixed dot, ex "html". | |
| 177 bool GetPreferredExtensionForMimeType(const std::string& mime_type, | |
| 178 FilePath::StringType* ext); | |
| 179 | |
| 180 // Sets a cookie string for the given URL. The policy_url argument indicates | 165 // Sets a cookie string for the given URL. The policy_url argument indicates |
| 181 // the URL of the topmost frame, which may be useful for determining whether or | 166 // the URL of the topmost frame, which may be useful for determining whether or |
| 182 // not to allow this cookie setting. NOTE: the cookie string is a standard | 167 // not to allow this cookie setting. NOTE: the cookie string is a standard |
| 183 // cookie string of the form "name=value; option1=x; option2=y" | 168 // cookie string of the form "name=value; option1=x; option2=y" |
| 184 void SetCookie(const GURL& url, const GURL& policy_url, | 169 void SetCookie(const GURL& url, const GURL& policy_url, |
| 185 const std::string& cookie); | 170 const std::string& cookie); |
| 186 | 171 |
| 187 // Returns all cookies in the form "a=1; b=2; c=3" for the given URL. NOTE: | 172 // Returns all cookies in the form "a=1; b=2; c=3" for the given URL. NOTE: |
| 188 // this string should not include any options that may have been specified when | 173 // this string should not include any options that may have been specified when |
| 189 // the cookie was set. Semicolons delimit individual cookies in this context. | 174 // the cookie was set. Semicolons delimit individual cookies in this context. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // coloring. | 290 // coloring. |
| 306 uint64 VisitedLinkHash(const char* canonical_url, size_t length); | 291 uint64 VisitedLinkHash(const char* canonical_url, size_t length); |
| 307 | 292 |
| 308 // Returns whether the given link hash is in the user's history. The hash must | 293 // Returns whether the given link hash is in the user's history. The hash must |
| 309 // have been generated by calling VisitedLinkHash(). | 294 // have been generated by calling VisitedLinkHash(). |
| 310 bool IsLinkVisited(uint64 link_hash); | 295 bool IsLinkVisited(uint64 link_hash); |
| 311 | 296 |
| 312 } // namespace webkit_glue | 297 } // namespace webkit_glue |
| 313 | 298 |
| 314 #endif // WEBKIT_GLUE_WEBKIT_GLUE_H_ | 299 #endif // WEBKIT_GLUE_WEBKIT_GLUE_H_ |
| OLD | NEW |