| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/extension_l10n_util.h" | 5 #include "chrome/common/extensions/extension_l10n_util.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/linked_ptr.h" | 13 #include "base/linked_ptr.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" | |
| 18 #include "chrome/common/extensions/extension.h" | 17 #include "chrome/common/extensions/extension.h" |
| 19 #include "chrome/common/extensions/extension_constants.h" | 18 #include "chrome/common/extensions/extension_constants.h" |
| 20 #include "chrome/common/extensions/extension_file_util.h" | 19 #include "chrome/common/extensions/extension_file_util.h" |
| 21 #include "chrome/common/extensions/extension_message_bundle.h" | 20 #include "chrome/common/extensions/extension_message_bundle.h" |
| 22 #include "chrome/common/json_value_serializer.h" | 21 #include "chrome/common/json_value_serializer.h" |
| 23 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 24 #include "unicode/uloc.h" | 23 #include "unicode/uloc.h" |
| 25 | 24 |
| 26 namespace errors = extension_manifest_errors; | 25 namespace errors = extension_manifest_errors; |
| 27 namespace keys = extension_manifest_keys; | 26 namespace keys = extension_manifest_keys; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // an error. | 288 // an error. |
| 290 return false; | 289 return false; |
| 291 } else { | 290 } else { |
| 292 catalogs.push_back(catalog); | 291 catalogs.push_back(catalog); |
| 293 } | 292 } |
| 294 } | 293 } |
| 295 | 294 |
| 296 return ExtensionMessageBundle::Create(catalogs, error); | 295 return ExtensionMessageBundle::Create(catalogs, error); |
| 297 } | 296 } |
| 298 | 297 |
| 299 void ApplyMessageFilterPolicy(const GURL& url, | |
| 300 const ResourceType::Type& resource_type, | |
| 301 ResourceDispatcherHostRequestInfo* request_info) { | |
| 302 // Apply filter only to chrome extension css files that don't have | |
| 303 // security filter already set. | |
| 304 if (url.SchemeIs(chrome::kExtensionScheme) && | |
| 305 request_info->filter_policy() == FilterPolicy::DONT_FILTER && | |
| 306 resource_type == ResourceType::STYLESHEET) | |
| 307 request_info->set_filter_policy(FilterPolicy::FILTER_EXTENSION_MESSAGES); | |
| 308 } | |
| 309 | |
| 310 } // namespace extension_l10n_util | 298 } // namespace extension_l10n_util |
| OLD | NEW |