| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 EXTENSION_ICON_BITTY = 16, | 55 EXTENSION_ICON_BITTY = 16, |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 // Icon sizes used by the extension system. | 58 // Icon sizes used by the extension system. |
| 59 static const int kIconSizes[]; | 59 static const int kIconSizes[]; |
| 60 | 60 |
| 61 // Each permission is a module that the extension is permitted to use. | 61 // Each permission is a module that the extension is permitted to use. |
| 62 static const char* kPermissionNames[]; | 62 static const char* kPermissionNames[]; |
| 63 static const size_t kNumPermissions; | 63 static const size_t kNumPermissions; |
| 64 | 64 |
| 65 // A classification of how dangerous an extension can be, based on what it has |
| 66 // access to. |
| 67 enum PermissionClass { |
| 68 PERMISSION_CLASS_LOW = 0, // green |
| 69 PERMISSION_CLASS_MEDIUM, // yellow |
| 70 PERMISSION_CLASS_HIGH, // orange |
| 71 PERMISSION_CLASS_FULL, // red |
| 72 }; |
| 73 |
| 65 // An NPAPI plugin included in the extension. | 74 // An NPAPI plugin included in the extension. |
| 66 struct PluginInfo { | 75 struct PluginInfo { |
| 67 FilePath path; // Path to the plugin. | 76 FilePath path; // Path to the plugin. |
| 68 bool is_public; // False if only this extension can load this plugin. | 77 bool is_public; // False if only this extension can load this plugin. |
| 69 }; | 78 }; |
| 70 | 79 |
| 71 // A toolstrip and its associated mole. | 80 // A toolstrip and its associated mole. |
| 72 struct ToolstripInfo { | 81 struct ToolstripInfo { |
| 73 ToolstripInfo() : mole_height(0) {} | 82 ToolstripInfo() : mole_height(0) {} |
| 74 | 83 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } | 207 DictionaryValue* GetThemeTints() const { return theme_tints_.get(); } |
| 199 DictionaryValue* GetThemeDisplayProperties() const { | 208 DictionaryValue* GetThemeDisplayProperties() const { |
| 200 return theme_display_properties_.get(); | 209 return theme_display_properties_.get(); |
| 201 } | 210 } |
| 202 bool IsTheme() { return is_theme_; } | 211 bool IsTheme() { return is_theme_; } |
| 203 | 212 |
| 204 // Returns a list of paths (relative to the extension dir) for images that | 213 // Returns a list of paths (relative to the extension dir) for images that |
| 205 // the browser might load (like themes and page action icons). | 214 // the browser might load (like themes and page action icons). |
| 206 std::set<FilePath> GetBrowserImages(); | 215 std::set<FilePath> GetBrowserImages(); |
| 207 | 216 |
| 217 PermissionClass GetPermissionClass(); |
| 218 |
| 208 | 219 |
| 209 // Runtime data: | 220 // Runtime data: |
| 210 // Put dynamic data about the state of a running extension below. | 221 // Put dynamic data about the state of a running extension below. |
| 211 | 222 |
| 212 // Whether the background page, if any, is ready. We don't load other | 223 // Whether the background page, if any, is ready. We don't load other |
| 213 // components until then. If there is no background page, we consider it to | 224 // components until then. If there is no background page, we consider it to |
| 214 // be ready. | 225 // be ready. |
| 215 bool GetBackgroundPageReady(); | 226 bool GetBackgroundPageReady(); |
| 216 void SetBackgroundPageReady(); | 227 void SetBackgroundPageReady(); |
| 217 | 228 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 330 |
| 320 // True if the background page is ready. | 331 // True if the background page is ready. |
| 321 bool background_page_ready_; | 332 bool background_page_ready_; |
| 322 | 333 |
| 323 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); | 334 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); |
| 324 | 335 |
| 325 DISALLOW_COPY_AND_ASSIGN(Extension); | 336 DISALLOW_COPY_AND_ASSIGN(Extension); |
| 326 }; | 337 }; |
| 327 | 338 |
| 328 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 339 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |