OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void set_apps_enabled(bool val) { apps_enabled_ = val; } | 82 void set_apps_enabled(bool val) { apps_enabled_ = val; } |
83 | 83 |
84 // Icon sizes used by the extension system. | 84 // Icon sizes used by the extension system. |
85 static const int kIconSizes[]; | 85 static const int kIconSizes[]; |
86 | 86 |
87 // Max size (both dimensions) for browser and page actions. | 87 // Max size (both dimensions) for browser and page actions. |
88 static const int kPageActionIconMaxSize; | 88 static const int kPageActionIconMaxSize; |
89 static const int kBrowserActionIconMaxSize; | 89 static const int kBrowserActionIconMaxSize; |
90 | 90 |
91 // Each permission is a module that the extension is permitted to use. | 91 // Each permission is a module that the extension is permitted to use. |
| 92 // |
| 93 // NOTE: If you add a permission, consider also changing: |
| 94 // - Extension::GetSimplePermissions() |
| 95 // - Extension::IsPrivilegeIncrease() |
| 96 // - ExtensionInstallUI::GetV2Warnings() |
92 static const char* kBackgroundPermission; | 97 static const char* kBackgroundPermission; |
93 static const char* kBookmarkPermission; | 98 static const char* kBookmarkPermission; |
94 static const char* kExperimentalPermission; | 99 static const char* kExperimentalPermission; |
95 static const char* kGeolocationPermission; | 100 static const char* kGeolocationPermission; |
96 static const char* kHistoryPermission; | 101 static const char* kHistoryPermission; |
97 static const char* kNotificationPermission; | 102 static const char* kNotificationPermission; |
98 static const char* kTabPermission; | 103 static const char* kTabPermission; |
99 static const char* kUnlimitedStoragePermission; | 104 static const char* kUnlimitedStoragePermission; |
100 | 105 |
101 static const char* kPermissionNames[]; | 106 static const char* kPermissionNames[]; |
102 static const size_t kNumPermissions; | 107 static const size_t kNumPermissions; |
103 | 108 |
| 109 // A "simple permission" is one that has a one-to-one mapping with a message |
| 110 // that is displayed in the install UI. This is in contrast to more complex |
| 111 // permissions like http access, where the exact message displayed depends on |
| 112 // several factors. |
| 113 typedef std::map<std::string, string16> SimplePermissions; |
| 114 static const SimplePermissions& GetSimplePermissions(); |
| 115 |
104 // An NPAPI plugin included in the extension. | 116 // An NPAPI plugin included in the extension. |
105 struct PluginInfo { | 117 struct PluginInfo { |
106 FilePath path; // Path to the plugin. | 118 FilePath path; // Path to the plugin. |
107 bool is_public; // False if only this extension can load this plugin. | 119 bool is_public; // False if only this extension can load this plugin. |
108 }; | 120 }; |
109 | 121 |
110 // A toolstrip and its associated mole. | 122 // A toolstrip and its associated mole. |
111 struct ToolstripInfo { | 123 struct ToolstripInfo { |
112 ToolstripInfo() : mole_height(0) {} | 124 ToolstripInfo() : mole_height(0) {} |
113 | 125 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 scoped_ptr<DictionaryValue> extension_manifest; | 593 scoped_ptr<DictionaryValue> extension_manifest; |
582 std::string extension_id; | 594 std::string extension_id; |
583 FilePath extension_path; | 595 FilePath extension_path; |
584 Extension::Location extension_location; | 596 Extension::Location extension_location; |
585 | 597 |
586 private: | 598 private: |
587 DISALLOW_COPY_AND_ASSIGN(ExtensionInfo); | 599 DISALLOW_COPY_AND_ASSIGN(ExtensionInfo); |
588 }; | 600 }; |
589 | 601 |
590 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 602 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |