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

Unified Diff: chrome/common/extensions/extension.h

Issue 170015: This change enables Chrome to load locale information for the extension. It d... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension.h
===================================================================
--- chrome/common/extensions/extension.h (revision 23230)
+++ chrome/common/extensions/extension.h (working copy)
@@ -5,6 +5,7 @@
#ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_
#define CHROME_COMMON_EXTENSIONS_EXTENSION_H_
+#include <map>
#include <set>
#include <string>
#include <vector>
@@ -89,6 +90,12 @@
// The name of the manifest inside an extension.
static const char kManifestFilename[];
+ // The name of locale folder inside an extension.
+ static const char kLocaleFolder[];
+
+ // The name of the messages file inside an extension.
+ static const char kMessagesFilename[];
+
#if defined(OS_WIN)
static const char* kExtensionRegistryPath;
#endif
@@ -216,7 +223,21 @@
PermissionClass GetPermissionClass();
+ // Returns a list of all locales supported by the extension.
+ const std::set<std::string>& supported_locales() const {
+ return supported_locales_;
+ }
+ // Add locale to the list of supported locales.
+ void AddSupportedLocale(const std::string& supported_locale) {
+ supported_locales_.insert(supported_locale);
+ }
+ // Getter/setter for a default_locale_.
+ const std::string& default_locale() const { return default_locale_; }
+ void set_default_locale(const std::string& default_locale) {
+ default_locale_ = default_locale;
+ }
+
// Runtime data:
// Put dynamic data about the state of a running extension below.
@@ -324,8 +345,13 @@
// URL for fetching an update manifest
GURL update_url_;
-
+ // List of all locales extension supports.
+ std::set<std::string> supported_locales_;
+
+ // Default locale, used for fallback.
+ std::string default_locale_;
+
// Runtime data:
// True if the background page is ready.

Powered by Google App Engine
This is Rietveld 408576698