1 // Copyright (c) 2013 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 EXTENSIONS_COMMON_INSTALL_WARNING_H_
6 #define EXTENSIONS_COMMON_INSTALL_WARNING_H_
11 namespace extensions
{
13 // A struct to describe a non-fatal issue discovered in the installation of an
15 struct InstallWarning
{
16 explicit InstallWarning(const std::string
& message
);
17 InstallWarning(const std::string
& message
,
18 const std::string
& key
);
19 InstallWarning(const std::string
& message
,
20 const std::string
& key
,
21 const std::string
& specific
);
24 bool operator==(const InstallWarning
& other
) const {
25 // We don't have to look at |key| or |specific| here, because they are each
26 // used in the the message itself.
27 // For example, a full message would be "Permission 'foo' is unknown or URL
28 // pattern is malformed." |key| here is "permissions", and |specific| is
29 // "foo", but these are redundant with the message.
30 return message
== other
.message
;
33 // The warning's message (human-friendly).
35 // Optional - for specifying the incorrect key in the manifest (e.g.,
38 // Optional - for specifying the incorrect portion of a key in the manifest
39 // (e.g., an unrecognized permission "foo" in "permissions").
43 // Let gtest print InstallWarnings.
44 void PrintTo(const InstallWarning
&, ::std::ostream
* os
);
46 } // namespace extensions
48 #endif // EXTENSIONS_COMMON_INSTALL_WARNING_H_