| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_COMMON_LOCALIZED_ERROR_H_ | 5 #ifndef CHROME_COMMON_LOCALIZED_ERROR_H_ |
| 6 #define CHROME_COMMON_LOCALIZED_ERROR_H_ | 6 #define CHROME_COMMON_LOCALIZED_ERROR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // Default search terms. Ignored if |search_url| is invalid. | 46 // Default search terms. Ignored if |search_url| is invalid. |
| 47 std::string search_terms; | 47 std::string search_terms; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // Fills |error_strings| with values to be used to build an error page used | 50 // Fills |error_strings| with values to be used to build an error page used |
| 51 // on HTTP errors, like 404 or connection reset. | 51 // on HTTP errors, like 404 or connection reset. |
| 52 static void GetStrings(int error_code, | 52 static void GetStrings(int error_code, |
| 53 const std::string& error_domain, | 53 const std::string& error_domain, |
| 54 const GURL& failed_url, | 54 const GURL& failed_url, |
| 55 bool is_post, | 55 bool is_post, |
| 56 bool stale_copy_in_cache, | 56 bool show_stale_load_button, |
| 57 const std::string& locale, | 57 const std::string& locale, |
| 58 const std::string& accept_languages, | 58 const std::string& accept_languages, |
| 59 scoped_ptr<ErrorPageParams> params, | 59 scoped_ptr<ErrorPageParams> params, |
| 60 base::DictionaryValue* strings); | 60 base::DictionaryValue* strings); |
| 61 | 61 |
| 62 // Returns a description of the encountered error. | 62 // Returns a description of the encountered error. |
| 63 static base::string16 GetErrorDetails(const blink::WebURLError& error, | 63 static base::string16 GetErrorDetails(const blink::WebURLError& error, |
| 64 bool is_post); | 64 bool is_post); |
| 65 | 65 |
| 66 // Returns true if an error page exists for the specified parameters. | 66 // Returns true if an error page exists for the specified parameters. |
| 67 static bool HasStrings(const std::string& error_domain, int error_code); | 67 static bool HasStrings(const std::string& error_domain, int error_code); |
| 68 | 68 |
| 69 // Fills |error_strings| with values to be used to build an error page used | 69 // Fills |error_strings| with values to be used to build an error page used |
| 70 // on HTTP errors, like 404 or connection reset, but using information from | 70 // on HTTP errors, like 404 or connection reset, but using information from |
| 71 // the associated |app| in order to make the error page look like it's more | 71 // the associated |app| in order to make the error page look like it's more |
| 72 // part of the app. | 72 // part of the app. |
| 73 static void GetAppErrorStrings(const GURL& display_url, | 73 static void GetAppErrorStrings(const GURL& display_url, |
| 74 const extensions::Extension* app, | 74 const extensions::Extension* app, |
| 75 base::DictionaryValue* error_strings); | 75 base::DictionaryValue* error_strings); |
| 76 | 76 |
| 77 static const char kHttpErrorDomain[]; | 77 static const char kHttpErrorDomain[]; |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalizedError); | 80 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalizedError); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 #endif // CHROME_COMMON_LOCALIZED_ERROR_H_ | 83 #endif // CHROME_COMMON_LOCALIZED_ERROR_H_ |
| OLD | NEW |