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 COMPONENTS_ERROR_PAGE_COMMON_LOCALIZED_ERROR_H_ | 5 #ifndef COMPONENTS_ERROR_PAGE_COMMON_LOCALIZED_ERROR_H_ |
6 #define COMPONENTS_ERROR_PAGE_COMMON_LOCALIZED_ERROR_H_ | 6 #define COMPONENTS_ERROR_PAGE_COMMON_LOCALIZED_ERROR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // Fills |error_strings| with values to be used to build an error page used | 25 // Fills |error_strings| with values to be used to build an error page used |
26 // on HTTP errors, like 404 or connection reset. | 26 // on HTTP errors, like 404 or connection reset. |
27 static void GetStrings(int error_code, | 27 static void GetStrings(int error_code, |
28 const std::string& error_domain, | 28 const std::string& error_domain, |
29 const GURL& failed_url, | 29 const GURL& failed_url, |
30 bool is_post, | 30 bool is_post, |
31 bool stale_copy_in_cache, | 31 bool stale_copy_in_cache, |
32 bool can_show_network_diagnostics_dialog, | 32 bool can_show_network_diagnostics_dialog, |
33 bool has_offline_pages, | 33 bool has_offline_pages, |
34 const std::string& locale, | 34 const std::string& locale, |
35 const std::string& accept_languages, | |
36 scoped_ptr<error_page::ErrorPageParams> params, | 35 scoped_ptr<error_page::ErrorPageParams> params, |
37 base::DictionaryValue* strings); | 36 base::DictionaryValue* strings); |
38 | 37 |
39 // Returns a description of the encountered error. | 38 // Returns a description of the encountered error. |
40 static base::string16 GetErrorDetails(const std::string& error_domain, | 39 static base::string16 GetErrorDetails(const std::string& error_domain, |
41 int error_code, | 40 int error_code, |
42 bool is_post); | 41 bool is_post); |
43 | 42 |
44 // Returns true if an error page exists for the specified parameters. | 43 // Returns true if an error page exists for the specified parameters. |
45 static bool HasStrings(const std::string& error_domain, int error_code); | 44 static bool HasStrings(const std::string& error_domain, int error_code); |
46 | 45 |
47 static const char kHttpErrorDomain[]; | 46 static const char kHttpErrorDomain[]; |
48 | 47 |
49 private: | 48 private: |
50 | 49 |
51 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalizedError); | 50 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalizedError); |
52 }; | 51 }; |
53 | 52 |
54 } // namespace error_page | 53 } // namespace error_page |
55 | 54 |
56 #endif // COMPONENTS_ERROR_PAGE_COMMON_LOCALIZED_ERROR_H_ | 55 #endif // COMPONENTS_ERROR_PAGE_COMMON_LOCALIZED_ERROR_H_ |
OLD | NEW |