| 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 #include "chrome/common/extensions/extension_constants.h" | 5 #include "chrome/common/extensions/extension_constants.h" |
| 6 | 6 |
| 7 namespace extension_manifest_keys { | 7 namespace extension_manifest_keys { |
| 8 | 8 |
| 9 const wchar_t* kAllFrames = L"all_frames"; | 9 const wchar_t* kAllFrames = L"all_frames"; |
| 10 const wchar_t* kBackground = L"background_page"; | 10 const wchar_t* kBackground = L"background_page"; |
| 11 const wchar_t* kBrowserAction = L"browser_action"; | 11 const wchar_t* kBrowserAction = L"browser_action"; |
| 12 const wchar_t* kChromeURLOverrides = L"chrome_url_overrides"; | 12 const wchar_t* kChromeURLOverrides = L"chrome_url_overrides"; |
| 13 const wchar_t* kContentScripts = L"content_scripts"; | 13 const wchar_t* kContentScripts = L"content_scripts"; |
| 14 const wchar_t* kConvertedFromUserScript = L"converted_from_user_script"; | 14 const wchar_t* kConvertedFromUserScript = L"converted_from_user_script"; |
| 15 const wchar_t* kCss = L"css"; | 15 const wchar_t* kCss = L"css"; |
| 16 const wchar_t* kCurrentLocale = L"current_locale"; | 16 const wchar_t* kCurrentLocale = L"current_locale"; |
| 17 const wchar_t* kDefaultLocale = L"default_locale"; | 17 const wchar_t* kDefaultLocale = L"default_locale"; |
| 18 const wchar_t* kDescription = L"description"; | 18 const wchar_t* kDescription = L"description"; |
| 19 const wchar_t* kIcons = L"icons"; | 19 const wchar_t* kIcons = L"icons"; |
| 20 const wchar_t* kJs = L"js"; | 20 const wchar_t* kJs = L"js"; |
| 21 const wchar_t* kMatches = L"matches"; | 21 const wchar_t* kMatches = L"matches"; |
| 22 const wchar_t* kMinimumChromeVersion = L"minimum_chrome_version"; |
| 22 const wchar_t* kIncludeGlobs = L"include_globs"; | 23 const wchar_t* kIncludeGlobs = L"include_globs"; |
| 23 const wchar_t* kExcludeGlobs = L"exclude_globs"; | 24 const wchar_t* kExcludeGlobs = L"exclude_globs"; |
| 24 const wchar_t* kName = L"name"; | 25 const wchar_t* kName = L"name"; |
| 25 const wchar_t* kPageActionId = L"id"; | 26 const wchar_t* kPageActionId = L"id"; |
| 26 const wchar_t* kPageAction = L"page_action"; | 27 const wchar_t* kPageAction = L"page_action"; |
| 27 const wchar_t* kPageActions = L"page_actions"; | 28 const wchar_t* kPageActions = L"page_actions"; |
| 28 const wchar_t* kPageActionIcons = L"icons"; | 29 const wchar_t* kPageActionIcons = L"icons"; |
| 29 const wchar_t* kPageActionDefaultIcon = L"default_icon"; | 30 const wchar_t* kPageActionDefaultIcon = L"default_icon"; |
| 30 const wchar_t* kPageActionDefaultTitle = L"default_title"; | 31 const wchar_t* kPageActionDefaultTitle = L"default_title"; |
| 31 const wchar_t* kPageActionPopup = L"popup"; | 32 const wchar_t* kPageActionPopup = L"popup"; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 60 const char* kRunAtDocumentIdle = "document_idle"; | 61 const char* kRunAtDocumentIdle = "document_idle"; |
| 61 const char* kPageActionTypeTab = "tab"; | 62 const char* kPageActionTypeTab = "tab"; |
| 62 const char* kPageActionTypePermanent = "permanent"; | 63 const char* kPageActionTypePermanent = "permanent"; |
| 63 } // namespace extension_manifest_values | 64 } // namespace extension_manifest_values |
| 64 | 65 |
| 65 // Extension-related error messages. Some of these are simple patterns, where a | 66 // Extension-related error messages. Some of these are simple patterns, where a |
| 66 // '*' is replaced at runtime with a specific value. This is used instead of | 67 // '*' is replaced at runtime with a specific value. This is used instead of |
| 67 // printf because we want to unit test them and scanf is hard to make | 68 // printf because we want to unit test them and scanf is hard to make |
| 68 // cross-platform. | 69 // cross-platform. |
| 69 namespace extension_manifest_errors { | 70 namespace extension_manifest_errors { |
| 71 const char* kChromeVersionTooLow = |
| 72 "This extension requires * version * or greater."; |
| 70 const char* kInvalidAllFrames = | 73 const char* kInvalidAllFrames = |
| 71 "Invalid value for 'content_scripts[*].all_frames'."; | 74 "Invalid value for 'content_scripts[*].all_frames'."; |
| 72 const char* kInvalidBrowserAction = | 75 const char* kInvalidBrowserAction = |
| 73 "Invalid value for 'browser_action'."; | 76 "Invalid value for 'browser_action'."; |
| 74 const char* kInvalidChromeURLOverrides = | 77 const char* kInvalidChromeURLOverrides = |
| 75 "Invalid value for 'chrome_url_overrides'."; | 78 "Invalid value for 'chrome_url_overrides'."; |
| 76 const char* kInvalidContentScript = | 79 const char* kInvalidContentScript = |
| 77 "Invalid value for 'content_scripts[*]'."; | 80 "Invalid value for 'content_scripts[*]'."; |
| 78 const char* kInvalidContentScriptsList = | 81 const char* kInvalidContentScriptsList = |
| 79 "Invalid value for 'content_scripts'."; | 82 "Invalid value for 'content_scripts'."; |
| 80 const char* kInvalidCss = | 83 const char* kInvalidCss = |
| 81 "Invalid value for 'content_scripts[*].css[*]'."; | 84 "Invalid value for 'content_scripts[*].css[*]'."; |
| 82 const char* kInvalidCssList = | 85 const char* kInvalidCssList = |
| 83 "Required value 'content_scripts[*].css is invalid."; | 86 "Required value 'content_scripts[*].css' is invalid."; |
| 84 const char* kInvalidDescription = | 87 const char* kInvalidDescription = |
| 85 "Invalid value for 'description'."; | 88 "Invalid value for 'description'."; |
| 86 const char* kInvalidGlobList = | 89 const char* kInvalidGlobList = |
| 87 "Invalid value for 'content_scripts[*].*'."; | 90 "Invalid value for 'content_scripts[*].*'."; |
| 88 const char* kInvalidGlob = | 91 const char* kInvalidGlob = |
| 89 "Invalid value for 'content_scripts[*].*[*]'."; | 92 "Invalid value for 'content_scripts[*].*[*]'."; |
| 90 const char* kInvalidIcons = | 93 const char* kInvalidIcons = |
| 91 "Invalid value for 'icons'."; | 94 "Invalid value for 'icons'."; |
| 92 const char* kInvalidIconPath = | 95 const char* kInvalidIconPath = |
| 93 "Invalid value for 'icons[\"*\"]'."; | 96 "Invalid value for 'icons[\"*\"]'."; |
| 94 const char* kInvalidJs = | 97 const char* kInvalidJs = |
| 95 "Invalid value for 'content_scripts[*].js[*]'."; | 98 "Invalid value for 'content_scripts[*].js[*]'."; |
| 96 const char* kInvalidJsList = | 99 const char* kInvalidJsList = |
| 97 "Required value 'content_scripts[*].js is invalid."; | 100 "Required value 'content_scripts[*].js' is invalid."; |
| 98 const char* kInvalidKey = | 101 const char* kInvalidKey = |
| 99 "Value 'key' is missing or invalid."; | 102 "Value 'key' is missing or invalid."; |
| 100 const char* kInvalidManifest = | 103 const char* kInvalidManifest = |
| 101 "Manifest file is invalid."; | 104 "Manifest file is invalid."; |
| 102 const char* kInvalidMatchCount = | 105 const char* kInvalidMatchCount = |
| 103 "Invalid value for 'content_scripts[*].matches. There must be at least one " | 106 "Invalid value for 'content_scripts[*].matches'. There must be at least" |
| 104 "match specified."; | 107 "one match specified."; |
| 105 const char* kInvalidMatch = | 108 const char* kInvalidMatch = |
| 106 "Invalid value for 'content_scripts[*].matches[*]'."; | 109 "Invalid value for 'content_scripts[*].matches[*]'."; |
| 107 const char* kInvalidMatches = | 110 const char* kInvalidMatches = |
| 108 "Required value 'content_scripts[*].matches' is missing or invalid."; | 111 "Required value 'content_scripts[*].matches' is missing or invalid."; |
| 112 const char* kInvalidMinimumChromeVersion = |
| 113 "Invalid value for 'minimum_chrome_version'."; |
| 109 const char* kInvalidName = | 114 const char* kInvalidName = |
| 110 "Required value 'name' is missing or invalid."; | 115 "Required value 'name' is missing or invalid."; |
| 111 const char* kInvalidPageAction = | 116 const char* kInvalidPageAction = |
| 112 "Invalid value for 'page_action'."; | 117 "Invalid value for 'page_action'."; |
| 113 const char* kInvalidPageActionName = | 118 const char* kInvalidPageActionName = |
| 114 "Invalid value for 'page_action.name'."; | 119 "Invalid value for 'page_action.name'."; |
| 115 const char* kInvalidPageActionIconPath = | 120 const char* kInvalidPageActionIconPath = |
| 116 "Invalid value for 'page_action.default_icon'."; | 121 "Invalid value for 'page_action.default_icon'."; |
| 117 const char* kInvalidPageActionsList = | 122 const char* kInvalidPageActionsList = |
| 118 "Invalid value for 'page_actions'."; | 123 "Invalid value for 'page_actions'."; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 "Invalid value for 'options_page'."; | 205 "Invalid value for 'options_page'."; |
| 201 } // namespace extension_manifest_errors | 206 } // namespace extension_manifest_errors |
| 202 | 207 |
| 203 namespace extension_urls { | 208 namespace extension_urls { |
| 204 const char* kGalleryBrowsePrefix = "https://chrome.google.com/extensions"; | 209 const char* kGalleryBrowsePrefix = "https://chrome.google.com/extensions"; |
| 205 const char* kGalleryDownloadPrefix = | 210 const char* kGalleryDownloadPrefix = |
| 206 "https://clients2.googleusercontent.com/crx/download"; | 211 "https://clients2.googleusercontent.com/crx/download"; |
| 207 const char* kMiniGalleryBrowsePrefix = "https://tools.google.com/chrome/"; | 212 const char* kMiniGalleryBrowsePrefix = "https://tools.google.com/chrome/"; |
| 208 const char* kMiniGalleryDownloadPrefix = "https://dl-ssl.google.com/chrome/"; | 213 const char* kMiniGalleryDownloadPrefix = "https://dl-ssl.google.com/chrome/"; |
| 209 } | 214 } |
| OLD | NEW |