OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/common/extensions/manifest_handlers/mime_types_handler.h" | 5 #include "extensions/common/manifest_handlers/mime_types_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/common/extensions/extension_constants.h" | 11 #include "extensions/common/constants.h" |
12 #include "extensions/common/error_utils.h" | 12 #include "extensions/common/error_utils.h" |
13 #include "extensions/common/manifest.h" | 13 #include "extensions/common/manifest.h" |
14 #include "extensions/common/manifest_constants.h" | 14 #include "extensions/common/manifest_constants.h" |
15 | 15 |
16 namespace keys = extensions::manifest_keys; | 16 namespace keys = extensions::manifest_keys; |
17 namespace errors = extensions::manifest_errors; | 17 namespace errors = extensions::manifest_errors; |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 const char* const kMIMETypeHandlersWhitelist[] = { | 21 const char* const kMIMETypeHandlersWhitelist[] = { |
22 extension_misc::kPdfExtensionId, | 22 extension_misc::kPdfExtensionId, |
23 extension_misc::kQuickOfficeComponentExtensionId, | 23 extension_misc::kQuickOfficeComponentExtensionId, |
24 extension_misc::kQuickOfficeInternalExtensionId, | 24 extension_misc::kQuickOfficeInternalExtensionId, |
25 extension_misc::kQuickOfficeExtensionId, | 25 extension_misc::kQuickOfficeExtensionId, |
26 extension_misc::kStreamsPrivateTestExtensionId}; | 26 extension_misc::kMimeHandlerPrivateTestExtensionId}; |
27 | 27 |
28 // Stored on the Extension. | 28 // Stored on the Extension. |
29 struct MimeTypesHandlerInfo : public extensions::Extension::ManifestData { | 29 struct MimeTypesHandlerInfo : public extensions::Extension::ManifestData { |
30 MimeTypesHandler handler_; | 30 MimeTypesHandler handler_; |
31 | 31 |
32 MimeTypesHandlerInfo(); | 32 MimeTypesHandlerInfo(); |
33 ~MimeTypesHandlerInfo() override; | 33 ~MimeTypesHandlerInfo() override; |
34 }; | 34 }; |
35 | 35 |
36 MimeTypesHandlerInfo::MimeTypesHandlerInfo() { | 36 MimeTypesHandlerInfo::MimeTypesHandlerInfo() { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 extension->SetManifestData(keys::kMimeTypesHandler, info.release()); | 108 extension->SetManifestData(keys::kMimeTypesHandler, info.release()); |
109 return true; | 109 return true; |
110 } | 110 } |
111 | 111 |
112 const std::vector<std::string> MimeTypesHandlerParser::Keys() const { | 112 const std::vector<std::string> MimeTypesHandlerParser::Keys() const { |
113 std::vector<std::string> keys; | 113 std::vector<std::string> keys; |
114 keys.push_back(keys::kMIMETypes); | 114 keys.push_back(keys::kMIMETypes); |
115 keys.push_back(keys::kMimeTypesHandler); | 115 keys.push_back(keys::kMimeTypesHandler); |
116 return keys; | 116 return keys; |
117 } | 117 } |
OLD | NEW |