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 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 static const wchar_t* kNameKey; | 44 static const wchar_t* kNameKey; |
45 static const wchar_t* kPageActionsKey; | 45 static const wchar_t* kPageActionsKey; |
46 static const wchar_t* kPermissionsKey; | 46 static const wchar_t* kPermissionsKey; |
47 static const wchar_t* kPluginsDirKey; | 47 static const wchar_t* kPluginsDirKey; |
48 static const wchar_t* kBackgroundKey; | 48 static const wchar_t* kBackgroundKey; |
49 static const wchar_t* kRunAtKey; | 49 static const wchar_t* kRunAtKey; |
50 static const wchar_t* kThemeKey; | 50 static const wchar_t* kThemeKey; |
51 static const wchar_t* kThemeImagesKey; | 51 static const wchar_t* kThemeImagesKey; |
52 static const wchar_t* kThemeColorsKey; | 52 static const wchar_t* kThemeColorsKey; |
53 static const wchar_t* kThemeTintsKey; | 53 static const wchar_t* kThemeTintsKey; |
| 54 static const wchar_t* kThemeDisplayPropertiesKey; |
54 static const wchar_t* kToolstripsKey; | 55 static const wchar_t* kToolstripsKey; |
55 static const wchar_t* kTooltipKey; | 56 static const wchar_t* kTooltipKey; |
56 static const wchar_t* kTypeKey; | 57 static const wchar_t* kTypeKey; |
57 static const wchar_t* kVersionKey; | 58 static const wchar_t* kVersionKey; |
58 static const wchar_t* kZipHashKey; | 59 static const wchar_t* kZipHashKey; |
59 | 60 |
60 // Some values expected in manifests. | 61 // Some values expected in manifests. |
61 static const char* kRunAtDocumentStartValue; | 62 static const char* kRunAtDocumentStartValue; |
62 static const char* kRunAtDocumentEndValue; | 63 static const char* kRunAtDocumentEndValue; |
63 static const char* kPageActionTypeTab; | 64 static const char* kPageActionTypeTab; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 const std::vector<URLPattern>& permissions() const { | 155 const std::vector<URLPattern>& permissions() const { |
155 return permissions_; } | 156 return permissions_; } |
156 | 157 |
157 // Retrieves a page action by |id|. | 158 // Retrieves a page action by |id|. |
158 const PageAction* GetPageAction(std::string id) const; | 159 const PageAction* GetPageAction(std::string id) const; |
159 | 160 |
160 // Theme-related | 161 // Theme-related |
161 DictionaryValue* GetThemeImages() const { return theme_images_.get(); } | 162 DictionaryValue* GetThemeImages() const { return theme_images_.get(); } |
162 DictionaryValue* GetThemeColors() const { return theme_colors_.get(); } | 163 DictionaryValue* GetThemeColors() const { return theme_colors_.get(); } |
163 DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } | 164 DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } |
| 165 DictionaryValue* GetThemeDisplayProperties() const { |
| 166 return theme_display_properties_.get(); |
| 167 } |
164 bool IsTheme() { return is_theme_; } | 168 bool IsTheme() { return is_theme_; } |
165 | 169 |
166 private: | 170 private: |
167 // Helper method that loads a UserScript object from a | 171 // Helper method that loads a UserScript object from a |
168 // dictionary in the content_script list of the manifest. | 172 // dictionary in the content_script list of the manifest. |
169 bool LoadUserScriptHelper(const DictionaryValue* content_script, | 173 bool LoadUserScriptHelper(const DictionaryValue* content_script, |
170 int definition_index, | 174 int definition_index, |
171 std::string* error, | 175 std::string* error, |
172 UserScript* result); | 176 UserScript* result); |
173 | 177 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 235 |
232 // A map of resource id's to relative file paths. | 236 // A map of resource id's to relative file paths. |
233 scoped_ptr<DictionaryValue> theme_images_; | 237 scoped_ptr<DictionaryValue> theme_images_; |
234 | 238 |
235 // A map of color names to colors. | 239 // A map of color names to colors. |
236 scoped_ptr<DictionaryValue> theme_colors_; | 240 scoped_ptr<DictionaryValue> theme_colors_; |
237 | 241 |
238 // A map of color names to colors. | 242 // A map of color names to colors. |
239 scoped_ptr<DictionaryValue> theme_tints_; | 243 scoped_ptr<DictionaryValue> theme_tints_; |
240 | 244 |
| 245 // A map of display properties. |
| 246 scoped_ptr<DictionaryValue> theme_display_properties_; |
| 247 |
241 // Whether the extension is a theme - if it is, certain things are disabled. | 248 // Whether the extension is a theme - if it is, certain things are disabled. |
242 bool is_theme_; | 249 bool is_theme_; |
243 | 250 |
244 // The sites this extension has permission to talk to (using XHR, etc). | 251 // The sites this extension has permission to talk to (using XHR, etc). |
245 std::vector<URLPattern> permissions_; | 252 std::vector<URLPattern> permissions_; |
246 | 253 |
247 DISALLOW_COPY_AND_ASSIGN(Extension); | 254 DISALLOW_COPY_AND_ASSIGN(Extension); |
248 }; | 255 }; |
249 | 256 |
250 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 257 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |