OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
zhchbin
2013/09/24 02:41:22
I think you may commit this file by accident.
Finnur
2013/09/24 10:53:23
Good catch.
| |
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 "extensions/common/manifest_constants.h" | 5 #include "chrome/common/extensions/extension_manifest_constants.h" |
6 | 6 |
7 namespace extensions { | 7 namespace extension_manifest_values { |
8 | |
9 namespace manifest_keys { | |
10 | |
11 const char kAllFrames[] = "all_frames"; | |
12 const char kAltKey[] = "altKey"; | |
13 const char kApp[] = "app"; | |
14 const char kAudio[] = "audio"; | |
15 const char kBackgroundAllowJsAccess[] = "background.allow_js_access"; | |
16 const char kBackgroundPage[] = "background.page"; | |
17 const char kBackgroundPageLegacy[] = "background_page"; | |
18 const char kBackgroundPersistent[] = "background.persistent"; | |
19 const char kBackgroundScripts[] = "background.scripts"; | |
20 const char kBrowserAction[] = "browser_action"; | |
21 const char kChromeURLOverrides[] = "chrome_url_overrides"; | |
22 const char kCommands[] = "commands"; | |
23 const char kContentPack[] = "content_pack"; | |
24 const char kContentPackSites[] = "sites"; | |
25 const char kContentScripts[] = "content_scripts"; | |
26 const char kContentSecurityPolicy[] = "content_security_policy"; | |
27 const char kConvertedFromUserScript[] = "converted_from_user_script"; | |
28 const char kCss[] = "css"; | |
29 const char kCtrlKey[] = "ctrlKey"; | |
30 const char kCurrentLocale[] = "current_locale"; | |
31 const char kDefaultLocale[] = "default_locale"; | |
32 const char kDescription[] = "description"; | |
33 const char kDevToolsPage[] = "devtools_page"; | |
34 const char kDisplayInLauncher[] = "display_in_launcher"; | |
35 const char kDisplayInNewTabPage[] = "display_in_new_tab_page"; | |
36 const char kEventName[] = "event_name"; | |
37 const char kExcludeGlobs[] = "exclude_globs"; | |
38 const char kExcludeMatches[] = "exclude_matches"; | |
39 const char kExport[] = "export"; | |
40 const char kExternallyConnectable[] = "externally_connectable"; | |
41 const char kFileAccessList[] = "file_access"; | |
42 const char kFileFilters[] = "file_filters"; | |
43 const char kFileBrowserHandlers[] = "file_browser_handlers"; | |
44 const char kMediaGalleriesHandlers[] = "media_galleries_handlers"; | |
45 const char kFileHandlers[] = "file_handlers"; | |
46 const char kFileHandlerExtensions[] = "extensions"; | |
47 const char kFileHandlerTitle[] = "title"; | |
48 const char kFileHandlerTypes[] = "types"; | |
49 const char kHomepageURL[] = "homepage_url"; | |
50 const char kIcons[] = "icons"; | |
51 const char kId[] = "id"; | |
52 const char kImport[] = "import"; | |
53 const char kIncognito[] = "incognito"; | |
54 const char kIncludeGlobs[] = "include_globs"; | |
55 const char kInputComponents[] = "input_components"; | |
56 const char kIsolation[] = "app.isolation"; | |
57 const char kJs[] = "js"; | |
58 const char kKey[] = "key"; | |
59 const char kKeycode[] = "keyCode"; | |
60 const char kKioskEnabled[] = "kiosk_enabled"; | |
61 const char kLanguage[] = "language"; | |
62 const char kLaunch[] = "app.launch"; | |
63 const char kLaunchContainer[] = "app.launch.container"; | |
64 const char kLaunchHeight[] = "app.launch.height"; | |
65 const char kLaunchLocalPath[] = "app.launch.local_path"; | |
66 const char kLaunchWebURL[] = "app.launch.web_url"; | |
67 const char kLaunchWidth[] = "app.launch.width"; | |
68 const char kLayouts[] = "layouts"; | |
69 const char kManifestVersion[] = "manifest_version"; | |
70 const char kMatches[] = "matches"; | |
71 const char kMinimumChromeVersion[] = "minimum_chrome_version"; | |
72 const char kMinimumVersion[] = "minimum_version"; | |
73 const char kMIMETypes[] = "mime_types"; | |
74 const char kMimeTypesHandler[] = "mime_types_handler"; | |
75 const char kName[] = "name"; | |
76 const char kNaClModules[] = "nacl_modules"; | |
77 const char kNaClModulesMIMEType[] = "mime_type"; | |
78 const char kNaClModulesPath[] = "path"; | |
79 const char kOAuth2[] = "oauth2"; | |
80 const char kOAuth2AutoApprove[] = "oauth2.auto_approve"; | |
81 const char kOAuth2ClientId[] = "oauth2.client_id"; | |
82 const char kOAuth2Scopes[] = "oauth2.scopes"; | |
83 const char kOfflineEnabled[] = "offline_enabled"; | |
84 const char kOmnibox[] = "omnibox"; | |
85 const char kOmniboxKeyword[] = "omnibox.keyword"; | |
86 const char kOptionalPermissions[] = "optional_permissions"; | |
87 const char kOptionsPage[] = "options_page"; | |
88 const char kPageAction[] = "page_action"; | |
89 const char kPageActionDefaultIcon[] = "default_icon"; | |
90 const char kPageActionDefaultPopup[] = "default_popup"; | |
91 const char kPageActionDefaultTitle[] = "default_title"; | |
92 const char kPageActionIcons[] = "icons"; | |
93 const char kPageActionId[] = "id"; | |
94 const char kPageActionPopup[] = "popup"; | |
95 const char kPageActionPopupPath[] = "path"; | |
96 const char kPageActions[] = "page_actions"; | |
97 const char kPermissions[] = "permissions"; | |
98 const char kPlatformAppBackground[] = "app.background"; | |
99 const char kPlatformAppBackgroundPage[] = "app.background.page"; | |
100 const char kPlatformAppBackgroundScripts[] = "app.background.scripts"; | |
101 const char kPlatformAppContentSecurityPolicy[] = "app.content_security_policy"; | |
102 const char kPlugins[] = "plugins"; | |
103 const char kPluginsPath[] = "path"; | |
104 const char kPluginsPublic[] = "public"; | |
105 const char kPublicKey[] = "key"; | |
106 const char kResources[] = "resources"; | |
107 const char kRequirements[] = "requirements"; | |
108 const char kRunAt[] = "run_at"; | |
109 const char kSandboxedPages[] = "sandbox.pages"; | |
110 const char kSandboxedPagesCSP[] = "sandbox.content_security_policy"; | |
111 const char kScriptBadge[] = "script_badge"; | |
112 const char kShiftKey[] = "shiftKey"; | |
113 const char kShortcutKey[] = "shortcutKey"; | |
114 const char kShortName[] = "short_name"; | |
115 const char kSignature[] = "signature"; | |
116 const char kSpellcheck[] = "spellcheck"; | |
117 const char kSpellcheckDictionaryFormat[] = "dictionary_format"; | |
118 const char kSpellcheckDictionaryLanguage[] = "dictionary_language"; | |
119 const char kSpellcheckDictionaryLocale[] = "dictionary_locale"; | |
120 const char kSpellcheckDictionaryPath[] = "dictionary_path"; | |
121 const char kStorageManagedSchema[] = "storage.managed_schema"; | |
122 const char kSuggestedKey[] = "suggested_key"; | |
123 const char kSystemIndicator[] = "system_indicator"; | |
124 const char kSystemInfoDisplay[] = "systemInfo.display"; | |
125 const char kTheme[] = "theme"; | |
126 const char kThemeColors[] = "colors"; | |
127 const char kThemeDisplayProperties[] = "properties"; | |
128 const char kThemeImages[] = "images"; | |
129 const char kThemeTints[] = "tints"; | |
130 const char kTtsEngine[] = "tts_engine"; | |
131 const char kTtsGenderFemale[] = "female"; | |
132 const char kTtsGenderMale[] = "male"; | |
133 const char kTtsVoices[] = "voices"; | |
134 const char kTtsVoicesEventTypeEnd[] = "end"; | |
135 const char kTtsVoicesEventTypeError[] = "error"; | |
136 const char kTtsVoicesEventTypeMarker[] = "marker"; | |
137 const char kTtsVoicesEventTypeSentence[] = "sentence"; | |
138 const char kTtsVoicesEventTypeStart[] = "start"; | |
139 const char kTtsVoicesEventTypeWord[] = "word"; | |
140 const char kTtsVoicesEventTypes[] = "event_types"; | |
141 const char kTtsVoicesGender[] = "gender"; | |
142 const char kTtsVoicesLang[] = "lang"; | |
143 const char kTtsVoicesVoiceName[] = "voice_name"; | |
144 const char kType[] = "type"; | |
145 const char kUpdateURL[] = "update_url"; | |
146 const char kUrlHandlers[] = "url_handlers"; | |
147 const char kUrlHandlerTitle[] = "title"; | |
148 const char kVersion[] = "version"; | |
149 const char kWebAccessibleResources[] = "web_accessible_resources"; | |
150 const char kWebURLs[] = "app.urls"; | |
151 | |
152 } // namespace manifest_keys | |
153 | |
154 namespace manifest_values { | |
155 | |
156 const char kBrowserActionCommandEvent[] = "_execute_browser_action"; | 8 const char kBrowserActionCommandEvent[] = "_execute_browser_action"; |
157 const char kIncognitoSplit[] = "split"; | 9 const char kIncognitoSplit[] = "split"; |
158 const char kIncognitoSpanning[] = "spanning"; | 10 const char kIncognitoSpanning[] = "spanning"; |
159 const char kIntentDispositionWindow[] = "window"; | 11 const char kIntentDispositionWindow[] = "window"; |
160 const char kIntentDispositionInline[] = "inline"; | 12 const char kIntentDispositionInline[] = "inline"; |
161 const char kIsolatedStorage[] = "storage"; | 13 const char kIsolatedStorage[] = "storage"; |
162 const char kKeybindingPlatformChromeOs[] = "chromeos"; | 14 const char kKeybindingPlatformChromeOs[] = "chromeos"; |
163 const char kKeybindingPlatformDefault[] = "default"; | 15 const char kKeybindingPlatformDefault[] = "default"; |
164 const char kKeybindingPlatformLinux[] = "linux"; | 16 const char kKeybindingPlatformLinux[] = "linux"; |
165 const char kKeybindingPlatformMac[] = "mac"; | 17 const char kKeybindingPlatformMac[] = "mac"; |
(...skipping 24 matching lines...) Expand all Loading... | |
190 const char kRunAtDocumentStart[] = "document_start"; | 42 const char kRunAtDocumentStart[] = "document_start"; |
191 const char kRunAtDocumentEnd[] = "document_end"; | 43 const char kRunAtDocumentEnd[] = "document_end"; |
192 const char kRunAtDocumentIdle[] = "document_idle"; | 44 const char kRunAtDocumentIdle[] = "document_idle"; |
193 const char kPageActionCommandEvent[] = "_execute_page_action"; | 45 const char kPageActionCommandEvent[] = "_execute_page_action"; |
194 const char kPageActionTypeTab[] = "tab"; | 46 const char kPageActionTypeTab[] = "tab"; |
195 const char kPageActionTypePermanent[] = "permanent"; | 47 const char kPageActionTypePermanent[] = "permanent"; |
196 const char kScriptBadgeCommandEvent[] = "_execute_script_badge"; | 48 const char kScriptBadgeCommandEvent[] = "_execute_script_badge"; |
197 const char kLaunchContainerPanel[] = "panel"; | 49 const char kLaunchContainerPanel[] = "panel"; |
198 const char kLaunchContainerTab[] = "tab"; | 50 const char kLaunchContainerTab[] = "tab"; |
199 const char kLaunchContainerWindow[] = "window"; | 51 const char kLaunchContainerWindow[] = "window"; |
200 | 52 } // namespace extension_manifest_values |
201 } // namespace manifest_values | |
202 | 53 |
203 // Extension-related error messages. Some of these are simple patterns, where a | 54 // Extension-related error messages. Some of these are simple patterns, where a |
204 // '*' is replaced at runtime with a specific value. This is used instead of | 55 // '*' is replaced at runtime with a specific value. This is used instead of |
205 // printf because we want to unit test them and scanf is hard to make | 56 // printf because we want to unit test them and scanf is hard to make |
206 // cross-platform. | 57 // cross-platform. |
207 namespace manifest_errors { | 58 namespace extension_manifest_errors { |
208 | |
209 const char kAppsNotEnabled[] = | 59 const char kAppsNotEnabled[] = |
210 "Apps are not enabled."; | 60 "Apps are not enabled."; |
211 const char kBackgroundPermissionNeeded[] = | 61 const char kBackgroundPermissionNeeded[] = |
212 "Hosted apps that use 'background_page' must have the 'background' " | 62 "Hosted apps that use 'background_page' must have the 'background' " |
213 "permission."; | 63 "permission."; |
214 const char kBackgroundRequiredForPlatformApps[] = | 64 const char kBackgroundRequiredForPlatformApps[] = |
215 "Packaged apps must have a background page or background scripts."; | 65 "Packaged apps must have a background page or background scripts."; |
216 const char kCannotAccessChromeUrl[] = "Cannot access a chrome:// URL"; | 66 const char kCannotAccessChromeUrl[] = "Cannot access a chrome:// URL"; |
217 const char kCannotAccessExtensionUrl[] = | 67 const char kCannotAccessExtensionUrl[] = |
218 "Cannot access a chrome-extension:// URL of different extension"; | 68 "Cannot access a chrome-extension:// URL of different extension"; |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
553 const char kInvalidTtsVoicesEventTypes[] = | 403 const char kInvalidTtsVoicesEventTypes[] = |
554 "Invalid value for 'tts_engine.voices[*].event_types'."; | 404 "Invalid value for 'tts_engine.voices[*].event_types'."; |
555 const char kInvalidTtsVoicesGender[] = | 405 const char kInvalidTtsVoicesGender[] = |
556 "Invalid value for 'tts_engine.voices[*].gender'."; | 406 "Invalid value for 'tts_engine.voices[*].gender'."; |
557 const char kInvalidTtsVoicesLang[] = | 407 const char kInvalidTtsVoicesLang[] = |
558 "Invalid value for 'tts_engine.voices[*].lang'."; | 408 "Invalid value for 'tts_engine.voices[*].lang'."; |
559 const char kInvalidTtsVoicesVoiceName[] = | 409 const char kInvalidTtsVoicesVoiceName[] = |
560 "Invalid value for 'tts_engine.voices[*].voice_name'."; | 410 "Invalid value for 'tts_engine.voices[*].voice_name'."; |
561 const char kInvalidUpdateURL[] = | 411 const char kInvalidUpdateURL[] = |
562 "Invalid value for update url: '[*]'."; | 412 "Invalid value for update url: '[*]'."; |
563 const char kInvalidURLHandlers[] = | |
564 "Invalid value for 'url_handlers'."; | |
565 const char kInvalidURLHandlerPatternElement[] = | |
566 "Invalid value for 'url_handlers[*]'."; | |
567 const char kInvalidURLHandlerTitle[] = | |
568 "Invalid value for 'url_handlers[*].title'."; | |
569 const char kInvalidURLHandlerPattern[] = | |
570 "Invalid value for 'url_handlers[*].matches[*]'."; | |
571 const char kInvalidURLPatternError[] = | 413 const char kInvalidURLPatternError[] = |
572 "Invalid url pattern '*'"; | 414 "Invalid url pattern '*'"; |
573 const char kInvalidVersion[] = | 415 const char kInvalidVersion[] = |
574 "Required value 'version' is missing or invalid. It must be between 1-4 " | 416 "Required value 'version' is missing or invalid. It must be between 1-4 " |
575 "dot-separated integers each between 0 and 65536."; | 417 "dot-separated integers each between 0 and 65536."; |
576 const char kInvalidWebAccessibleResourcesList[] = | 418 const char kInvalidWebAccessibleResourcesList[] = |
577 "Invalid value for 'web_accessible_resources'."; | 419 "Invalid value for 'web_accessible_resources'."; |
578 const char kInvalidWebAccessibleResource[] = | 420 const char kInvalidWebAccessibleResource[] = |
579 "Invalid value for 'web_accessible_resources[*]'."; | 421 "Invalid value for 'web_accessible_resources[*]'."; |
580 const char kInvalidWebURL[] = | 422 const char kInvalidWebURL[] = |
(...skipping 10 matching lines...) Expand all Loading... | |
591 " \"'unsafe-eval'\", \"http://127.0.0.1\", \"http://localhost\", or any" | 433 " \"'unsafe-eval'\", \"http://127.0.0.1\", \"http://localhost\", or any" |
592 " \"https://\" or \"chrome-extension://\" origin. For more information," | 434 " \"https://\" or \"chrome-extension://\" origin. For more information," |
593 " see http://developer.chrome.com/extensions/contentSecurityPolicy.html"; | 435 " see http://developer.chrome.com/extensions/contentSecurityPolicy.html"; |
594 const char kLaunchPathAndExtentAreExclusive[] = | 436 const char kLaunchPathAndExtentAreExclusive[] = |
595 "The 'app.launch.local_path' and 'app.urls' keys cannot both be set."; | 437 "The 'app.launch.local_path' and 'app.urls' keys cannot both be set."; |
596 const char kLaunchPathAndURLAreExclusive[] = | 438 const char kLaunchPathAndURLAreExclusive[] = |
597 "The 'app.launch.local_path' and 'app.launch.web_url' keys cannot " | 439 "The 'app.launch.local_path' and 'app.launch.web_url' keys cannot " |
598 "both be set."; | 440 "both be set."; |
599 const char kLaunchURLRequired[] = | 441 const char kLaunchURLRequired[] = |
600 "Either 'app.launch.local_path' or 'app.launch.web_url' is required."; | 442 "Either 'app.launch.local_path' or 'app.launch.web_url' is required."; |
601 const char kLocalesInvalidLocale[] = | |
602 "Invalid locale file '*': *"; | |
603 const char kLocalesMessagesFileMissing[] = | 443 const char kLocalesMessagesFileMissing[] = |
604 "Messages file is missing for locale."; | 444 "Messages file is missing for locale."; |
605 const char kLocalesNoDefaultLocaleSpecified[] = | 445 const char kLocalesNoDefaultLocaleSpecified[] = |
606 "Localization used, but default_locale wasn't specified in the manifest."; | 446 "Localization used, but default_locale wasn't specified in the manifest."; |
607 const char kLocalesNoDefaultMessages[] = | 447 const char kLocalesNoDefaultMessages[] = |
608 "Default locale is defined but default data couldn't be loaded."; | 448 "Default locale is defined but default data couldn't be loaded."; |
609 const char kLocalesNoValidLocaleNamesListed[] = | 449 const char kLocalesNoValidLocaleNamesListed[] = |
610 "No valid locale name could be found in _locales directory."; | 450 "No valid locale name could be found in _locales directory."; |
611 const char kLocalesTreeMissing[] = | 451 const char kLocalesTreeMissing[] = |
612 "Default locale was specified, but _locales subtree is missing."; | 452 "Default locale was specified, but _locales subtree is missing."; |
(...skipping 10 matching lines...) Expand all Loading... | |
623 const char kNoWildCardsInPaths[] = | 463 const char kNoWildCardsInPaths[] = |
624 "Wildcards are not allowed in extent URL pattern paths."; | 464 "Wildcards are not allowed in extent URL pattern paths."; |
625 const char kOneUISurfaceOnly[] = | 465 const char kOneUISurfaceOnly[] = |
626 "Only one of 'browser_action', 'page_action', and 'app' can be specified."; | 466 "Only one of 'browser_action', 'page_action', and 'app' can be specified."; |
627 const char kPermissionMustBeOptional[] = | 467 const char kPermissionMustBeOptional[] = |
628 "Permission '*' must be specified in the optional section of the manifest."; | 468 "Permission '*' must be specified in the optional section of the manifest."; |
629 const char kPermissionNotAllowed[] = | 469 const char kPermissionNotAllowed[] = |
630 "Access to permission '*' denied."; | 470 "Access to permission '*' denied."; |
631 const char kPermissionNotAllowedInManifest[] = | 471 const char kPermissionNotAllowedInManifest[] = |
632 "Permission '*' cannot be specified in the manifest."; | 472 "Permission '*' cannot be specified in the manifest."; |
633 const char kPermissionUnknownOrMalformed[] = | |
634 "Permission '*' is unknown or URL pattern is malformed."; | |
635 const char kReservedMessageFound[] = | 473 const char kReservedMessageFound[] = |
636 "Reserved key * found in message catalog."; | 474 "Reserved key * found in message catalog."; |
637 const char kScriptBadgeRequiresFlag[] = | 475 const char kScriptBadgeRequiresFlag[] = |
638 "The script_badge manifest key is turned off by default. " | 476 "The script_badge manifest key is turned off by default. " |
639 "You can enable it with the --enable-script-badges command-line flag."; | 477 "You can enable it with the --enable-script-badges command-line flag."; |
640 const char kScriptBadgeIconIgnored[] = | 478 const char kScriptBadgeIconIgnored[] = |
641 "default_icon specified in script_badge manifest section will not be used."; | 479 "default_icon specified in script_badge manifest section will not be used."; |
642 const char kScriptBadgeTitleIgnored[] = | 480 const char kScriptBadgeTitleIgnored[] = |
643 "default_title specified in script_badge manifest section will not be " | 481 "default_title specified in script_badge manifest section will not be " |
644 "used."; | 482 "used."; |
645 const char kUnrecognizedManifestKey[] = "Unrecognized manifest key '*'."; | |
646 const char kWebRequestConflictsWithLazyBackground[] = | 483 const char kWebRequestConflictsWithLazyBackground[] = |
647 "The 'webRequest' API cannot be used with event pages."; | 484 "The 'webRequest' API cannot be used with event pages."; |
648 #if defined(OS_CHROMEOS) | 485 #if defined(OS_CHROMEOS) |
649 const char kIllegalPlugins[] = | 486 const char kIllegalPlugins[] = |
650 "Extensions cannot install plugins on Chrome OS"; | 487 "Extensions cannot install plugins on Chrome OS"; |
651 #endif | 488 #endif |
652 | 489 } // namespace extension_manifest_errors |
653 } // namespace manifest_errors | |
654 | |
655 } // namespace extensions | |
OLD | NEW |