| 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 CHROME_RENDERER_LOCALIZED_ERROR_H_ | 5 #ifndef CHROME_RENDERER_LOCALIZED_ERROR_H_ |
| 6 #define CHROME_RENDERER_LOCALIZED_ERROR_H_ | 6 #define CHROME_RENDERER_LOCALIZED_ERROR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 | 12 |
| 13 class DictionaryValue; | 13 class DictionaryValue; |
| 14 class ExtensionRendererInfo; | 14 class Extension; |
| 15 class GURL; | 15 class GURL; |
| 16 | 16 |
| 17 namespace WebKit { | 17 namespace WebKit { |
| 18 struct WebURLError; | 18 struct WebURLError; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class LocalizedError { | 21 class LocalizedError { |
| 22 public: | 22 public: |
| 23 // Fills |error_strings| with values to be used to build an error page used | 23 // Fills |error_strings| with values to be used to build an error page used |
| 24 // on HTTP errors, like 404 or connection reset. | 24 // on HTTP errors, like 404 or connection reset. |
| 25 static void GetStrings(const WebKit::WebURLError& error, | 25 static void GetStrings(const WebKit::WebURLError& error, |
| 26 DictionaryValue* strings); | 26 DictionaryValue* strings); |
| 27 | 27 |
| 28 // Returns true if an error page exists for the specified parameters. | 28 // Returns true if an error page exists for the specified parameters. |
| 29 static bool HasStrings(const std::string& error_domain, int error_code); | 29 static bool HasStrings(const std::string& error_domain, int error_code); |
| 30 | 30 |
| 31 // Fills |error_strings| with values to be used to build an error page which | 31 // Fills |error_strings| with values to be used to build an error page which |
| 32 // warns against reposting form data. This is special cased because the form | 32 // warns against reposting form data. This is special cased because the form |
| 33 // repost "error page" has no real error associated with it, and doesn't have | 33 // repost "error page" has no real error associated with it, and doesn't have |
| 34 // enough strings localized to meaningfully fill the net error template. | 34 // enough strings localized to meaningfully fill the net error template. |
| 35 static void GetFormRepostStrings(const GURL& display_url, | 35 static void GetFormRepostStrings(const GURL& display_url, |
| 36 DictionaryValue* error_strings); | 36 DictionaryValue* error_strings); |
| 37 | 37 |
| 38 // Fills |error_strings| with values to be used to build an error page used | 38 // Fills |error_strings| with values to be used to build an error page used |
| 39 // on HTTP errors, like 404 or connection reset, but using information from | 39 // on HTTP errors, like 404 or connection reset, but using information from |
| 40 // the associated |app| in order to make the error page look like it's more | 40 // the associated |app| in order to make the error page look like it's more |
| 41 // part of the app. | 41 // part of the app. |
| 42 static void GetAppErrorStrings(const WebKit::WebURLError& error, | 42 static void GetAppErrorStrings(const WebKit::WebURLError& error, |
| 43 const GURL& display_url, | 43 const GURL& display_url, |
| 44 const ExtensionRendererInfo* app, | 44 const Extension* app, |
| 45 DictionaryValue* error_strings); | 45 DictionaryValue* error_strings); |
| 46 | 46 |
| 47 static const char kHttpErrorDomain[]; | 47 static const char kHttpErrorDomain[]; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalizedError); | 50 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalizedError); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 #endif // CHROME_RENDERER_LOCALIZED_ERROR_H_ | 53 #endif // CHROME_RENDERER_LOCALIZED_ERROR_H_ |
| OLD | NEW |