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

Side by Side Diff: chrome/common/extensions/extension_l10n_util.cc

Issue 570007: Replace __MSG_some_name__ template within extension css/html files with local... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 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) 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/extensions/extension_file_util.h" 17 #include "chrome/browser/extensions/extension_file_util.h"
18 #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h"
18 #include "chrome/common/extensions/extension.h" 19 #include "chrome/common/extensions/extension.h"
19 #include "chrome/common/extensions/extension_constants.h" 20 #include "chrome/common/extensions/extension_constants.h"
20 #include "chrome/common/extensions/extension_message_bundle.h" 21 #include "chrome/common/extensions/extension_message_bundle.h"
21 #include "chrome/common/json_value_serializer.h" 22 #include "chrome/common/json_value_serializer.h"
23 #include "chrome/common/url_constants.h"
22 #include "unicode/uloc.h" 24 #include "unicode/uloc.h"
23 25
24 namespace errors = extension_manifest_errors; 26 namespace errors = extension_manifest_errors;
25 namespace keys = extension_manifest_keys; 27 namespace keys = extension_manifest_keys;
26 28
27 static std::string* GetProcessLocale() { 29 static std::string* GetProcessLocale() {
28 static std::string locale; 30 static std::string locale;
29 return &locale; 31 return &locale;
30 } 32 }
31 33
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 // an error. 289 // an error.
288 return false; 290 return false;
289 } else { 291 } else {
290 catalogs.push_back(catalog); 292 catalogs.push_back(catalog);
291 } 293 }
292 } 294 }
293 295
294 return ExtensionMessageBundle::Create(catalogs, error); 296 return ExtensionMessageBundle::Create(catalogs, error);
295 } 297 }
296 298
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
297 } // namespace extension_l10n_util 310 } // namespace extension_l10n_util
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_l10n_util.h ('k') | chrome/common/extensions/extension_l10n_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698