Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: extensions/common/install_warning.h

Issue 16464004: Turn disallowed URL patterns such as <all_urls> for externally_connectable into (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test that warnings also imply failure Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 EXTENSIONS_COMMON_INSTALL_WARNING_H_ 5 #ifndef EXTENSIONS_COMMON_INSTALL_WARNING_H_
6 #define EXTENSIONS_COMMON_INSTALL_WARNING_H_ 6 #define EXTENSIONS_COMMON_INSTALL_WARNING_H_
7 7
8 #include <ostream> 8 #include <ostream>
9 #include <string> 9 #include <string>
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 struct InstallWarning { 13 struct InstallWarning {
14 enum Format { 14 enum Format {
15 // IMPORTANT: Do not build HTML strings from user or developer-supplied 15 // IMPORTANT: Do not build HTML strings from user or developer-supplied
16 // input. 16 // input.
17 FORMAT_TEXT, 17 FORMAT_TEXT,
18 FORMAT_HTML, 18 FORMAT_HTML,
19 }; 19 };
20 static InstallWarning Text(const std::string& message) {
21 return InstallWarning(FORMAT_TEXT, message);
22 }
20 InstallWarning(Format format, const std::string& message) 23 InstallWarning(Format format, const std::string& message)
21 : format(format), message(message) { 24 : format(format), message(message) {
22 } 25 }
23 bool operator==(const InstallWarning& other) const { 26 bool operator==(const InstallWarning& other) const {
24 return format == other.format && message == other.message; 27 return format == other.format && message == other.message;
25 } 28 }
26 Format format; 29 Format format;
27 std::string message; 30 std::string message;
28 }; 31 };
29 32
30 // Let gtest print InstallWarnings. 33 // Let gtest print InstallWarnings.
31 void PrintTo(const InstallWarning&, ::std::ostream* os); 34 void PrintTo(const InstallWarning&, ::std::ostream* os);
32 35
33 } // namespace 36 } // namespace
34 37
35 #endif // EXTENSIONS_COMMON_INSTALL_WARNING_H_ 38 #endif // EXTENSIONS_COMMON_INSTALL_WARNING_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/manifest_handlers/externally_connectable_unittest.cc ('k') | extensions/common/url_pattern_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698