Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / common / localized_error.h
blobbd6e1a9118e55b71adebbc18d3b17de805710eff
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
3 // found in the LICENSE file.
5 #ifndef CHROME_COMMON_LOCALIZED_ERROR_H_
6 #define CHROME_COMMON_LOCALIZED_ERROR_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/strings/string16.h"
13 #include "url/gurl.h"
15 namespace base {
16 class DictionaryValue;
17 class ListValue;
20 namespace blink {
21 struct WebURLError;
24 namespace error_page {
25 struct ErrorPageParams;
28 class LocalizedError {
29 public:
30 // Fills |error_strings| with values to be used to build an error page used
31 // on HTTP errors, like 404 or connection reset.
32 static void GetStrings(int error_code,
33 const std::string& error_domain,
34 const GURL& failed_url,
35 bool is_post,
36 bool stale_copy_in_cache,
37 const std::string& locale,
38 const std::string& accept_languages,
39 scoped_ptr<error_page::ErrorPageParams> params,
40 base::DictionaryValue* strings);
42 // Returns a description of the encountered error.
43 static base::string16 GetErrorDetails(const blink::WebURLError& error,
44 bool is_post);
46 // Returns true if an error page exists for the specified parameters.
47 static bool HasStrings(const std::string& error_domain, int error_code);
49 static const char kHttpErrorDomain[];
51 private:
52 // Sets up the Google Cached Copy button experiment if part of the
53 // field trial. This promotes the Google cached copy suggestion from under
54 // the details section to a blue button. Also experiments with the
55 // button label.
56 static void EnableGoogleCachedCopyButtonExperiment(
57 base::ListValue* suggestions,
58 base::DictionaryValue* error_strings);
60 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalizedError);
63 #endif // CHROME_COMMON_LOCALIZED_ERROR_H_