summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_file_util.cc
Commit message (Collapse)AuthorAgeFilesLines
* ExtensionResource::GetFilePath returns empty path if itfinnur@chromium.org2009-11-111-4/+6
| | | | | | | | | | | | | | | fails to resolve the css and js script files specified in the manifest. We shouldn't rely on the results of GetFilePath in the error, but show the relative path instead. BUG=27423 TEST=Create an extension with a content script, but specify a css and a js file that doesn't exist. The error message should be descriptive and make sense. Review URL: http://codereview.chromium.org/385052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31733 0039d316-1c4b-4281-b951-d872f2087c98
* Filter out hidden files, both when loading extensions and whenaa@chromium.org2009-10-281-1/+2
| | | | | | | | | | | | | packaging them. We also special case the common OS X zip dropping "__MACOSX" when loading extensions. BUG=23004 Review URL: http://codereview.chromium.org/340018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30312 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bug where many extensions don't install due to sandbox.aa@chromium.org2009-10-271-1/+1
| | | | | | | | | | | | | | FWIW, I tracked down why our tests didn't find this. We do have coverage for the code path that was getting executed, but the sandbox is disabled in our browser tests, so it did not expose this issue. BUG=25865 TEST=Install any extension that has a content script or icons (test/data/extensions/good.crx is one example). Go to chrome://extensions/. You should see the extension successfully installed. Review URL: http://codereview.chromium.org/337041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30282 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes bug introduced in r28333, where we were checking if path.empty() ↵cira@chromium.org2009-10-271-9/+20
| | | | | | | | | | | | | instead of !PathExists(path). In addition makes background page load check. BUG=24041 TEST=Try loading extension with content script that doesn't exist on disk, but is listed in manifest. Review URL: http://codereview.chromium.org/335037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30217 0039d316-1c4b-4281-b951-d872f2087c98
* Replace ExtensionAction with ExtensionAction2.aa@chromium.org2009-10-271-2/+2
| | | | | | | | BUG=24472 Review URL: http://codereview.chromium.org/337035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30172 0039d316-1c4b-4281-b951-d872f2087c98
* Move page actions over to ExtensionAction2 and get rid ofaa@chromium.org2009-10-271-8/+10
| | | | | | | | | | | | | extension_action.*. Final bit of refactor will be to rename ExtensionAction2 to ExtensionAction will be the next CL. BUG=24472,25844 Review URL: http://codereview.chromium.org/332021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30133 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor BrowserActions, and add support foraa@chromium.org2009-10-241-4/+4
| | | | | | | | | | | | | | | | | tab-specific state. Future changelists will move Page Actions over to ExtensionAction2, then replace ExtensionAction and ExtensionActionState with ExtensionAction2. Also, fix a bug in setIcon({path:...}) where it would work only the first time. BUG=24669,24472 Review URL: http://codereview.chromium.org/306044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29997 0039d316-1c4b-4281-b951-d872f2087c98
* Implementing better fallback algorithm.cira@chromium.org2009-10-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Before: current_locale->default_locale Now: current_locale->chain_of_parent_locales->default_locale If default_locale is de, and current locale en_US, we follow: en_US -> en -> de en is not a Chrome locale (only en_US, en_GB are), but we fake it to allow this kind of fallback. Developers can implement common locale root with most of the messages (like en) and put locale specifics in en_GB (color->colour) or en_US. You can even symlink en and en_US and save on work. I am planning on fixing loading local resources too, to use this child->parent fallback. BUG=12131 Review URL: http://codereview.chromium.org/293037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29684 0039d316-1c4b-4281-b951-d872f2087c98
* Minimize dependency of user scripts.mad@chromium.org2009-10-201-4/+6
| | | | | | | | | | | And made some minor lint fixes and code refactoring on the way, based on CR comments of previous attempt. BUG=none TEST=Make sure that the extension resources can still be properly localized and that they also load correctly when they are not localized. Review URL: http://codereview.chromium.org/267051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29512 0039d316-1c4b-4281-b951-d872f2087c98
* More style nits.erg@google.com2009-10-141-1/+1
| | | | | | | | (Working on cleaning chrome/ so hopefully we can lint it by default.) Review URL: http://codereview.chromium.org/274040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28971 0039d316-1c4b-4281-b951-d872f2087c98
* Update page action manifest parsing to match the new format.mpcomplete@chromium.org2009-10-131-4/+2
| | | | | | | | | | Preserves backwards compatability with the old manifest format. BUG=24635 Review URL: http://codereview.chromium.org/275007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28912 0039d316-1c4b-4281-b951-d872f2087c98
* Improve error messages when a manifest is not readable or not valid JSON.aa@chromium.org2009-10-091-2/+14
| | | | | | Review URL: http://codereview.chromium.org/251003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28601 0039d316-1c4b-4281-b951-d872f2087c98
* Loads local resources from current locale subtree if available, if not it ↵cira@chromium.org2009-10-071-7/+9
| | | | | | | | | | | | | | | | | falls back to extension subtree. We look for ext_root/foo/bar.js under ext_root/_locales/fr/foo/bar.js if current locale is fr. If there is no fr specific resource we load ext_root/foo/bar.js instead. Lots of small refactoring to replace FilePath with ExtensionResource. BUG=12131 TEST=See unittest for sample tree. Review URL: http://codereview.chromium.org/256022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28333 0039d316-1c4b-4281-b951-d872f2087c98
* Moving ContextualAction class to common/extensions and in the process ↵finnur@chromium.org2009-09-281-4/+4
| | | | | | | | | | | | | renaming it ExtensionAction. No code change. BUG=None TEST=Page actions and browser actions should work as before (no change) Review URL: http://codereview.chromium.org/242035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27406 0039d316-1c4b-4281-b951-d872f2087c98
* Implement Browser Actions extensions.finnur@chromium.org2009-09-261-3/+17
| | | | | | | | | | | | | | | | Browser Actions are like Page Actions, except they appear next to the Omnibox and are always visible. For details see http://code.google.com/p/chromium/wiki/BrowserActions. Added a simple browser action sample that adds a Print button to the chrome toolbar (which brings up the Print dialog for the current page). Removed |type| from PageActions, which is currently ignored and was already removed from the docs. Each extension can only have 1 browser_action. Each browser action can specify more than one icon, but only the first is used. And no API has been added yet (besides the event definition). BUG=22099 TEST=Install the sample browser action, navigate to google.com, press the print button. A print dialog should come up. Review URL: http://codereview.chromium.org/243001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27319 0039d316-1c4b-4281-b951-d872f2087c98
* Actually run directory validation code on install.aa@chromium.org2009-09-251-2/+2
| | | | | | | | | BUG=23084 TEST=Install extensions attached to referenced bug. You should get an error dialog, not a crash. Review URL: http://codereview.chromium.org/244012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27261 0039d316-1c4b-4281-b951-d872f2087c98
* CL is the same as http://codereview.chromium.org/173487, but had to be moved ↵cira@chromium.org2009-09-181-19/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to new CL number because I switched machines. Implemented the rest of loading/parsing logic for extension i18n: 1. Loading message catalogs for default and application locale. 2. Parsing JSON and replacing placeholders with actual content within a message. 3. Creating unified dictionary (union of default and application dictionaries, where application dict. has priority for common messages). New class ExtensionMessageBundle holds new dictionary, and parses data. It's injected into Extension. ExtensionMessageHandler::ReplaceVariablesInString can replace both $placeholders$ and __MSG_messages__ in given string (HTML, manifest, actual message string...). Implemented actual manifest name/description replacement too, as an example. Extension is now pretty agnostic about localization, and this makes it easier to use message bundles with things that are not extensions... BUG=12131 Review URL: http://codereview.chromium.org/202063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26609 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of the extension's "Current Version" file.mpcomplete@chromium.org2009-08-201-117/+57
| | | | | | | | | | | | The entire manifest.json value is now stored in the prefs file. This will allow for quick extension checks on startup. BUG=18293 TEST=Make sure installing/upgrading/uninstalling extensions works as expected. Review URL: http://codereview.chromium.org/174036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23848 0039d316-1c4b-4281-b951-d872f2087c98
* This change enables Chrome to load locale information for the extension. It ↵cira@chromium.org2009-08-191-0/+60
| | | | | | | | | | | | | | | | | | | | | | detects default locale, and filters out all locales not supported by Chrome or with invalid names/missing messages. It also checks for folders that start with _ and are not in the reserved list. We don't validate messages file with this CL. Added support for loading supplied locale information to the extension_file_util, and detecting default locale. Added new constants to extension class (_locales directory name, messages filename). Added new error messages to _constants. Added new unittests. BUG=12131 TEST=There should be no visible changes, except in case of error when loading extension (e.g. create empty _locales folder and try loading). Review URL: http://codereview.chromium.org/170015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23739 0039d316-1c4b-4281-b951-d872f2087c98
* Lands <http://codereview.chromium.org/165297> for thiago.farina@gmail.com.hbono@chromium.org2009-08-191-1/+1
| | | | | | | | | | | | | | R=me From Thiago: Replaces some TrimWhitespace with TrimWhitespaceASCII or TrimWhitespaceUTF8. BUG=9851 TEST=run base_unittests.exe, unit_tests.exe and ui_tests.exe Review URL: http://codereview.chromium.org/172039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23703 0039d316-1c4b-4281-b951-d872f2087c98
* Add privacy_blacklists key to extension manifest and validate it.phajdan.jr@chromium.org2009-08-131-0/+12
| | | | | | | | | | | This is the first step towards shipping privacy blacklists in extensions. TEST=Covered by unit_tests. BUG=none Review URL: http://codereview.chromium.org/164349 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23316 0039d316-1c4b-4281-b951-d872f2087c98
* extensions: clean up some code I saw while tracking down a bugevan@chromium.org2009-08-051-4/+3
| | | | | | | | The bug was already fixed, but this change shouldn't hurt too. Review URL: http://codereview.chromium.org/162020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22524 0039d316-1c4b-4281-b951-d872f2087c98
* Implement first cut at the extension installation prompt on Windows.aa@chromium.org2009-08-041-5/+4
| | | | | | | | | | | | Had to move set_path() earlier in the unpack process so that we would have real paths for the resources, so that we could load and display the icon in the ui. This exposed a problem where page actions had absolute paths and other images in extensions had relative paths. Extension::GetBrowserImages() was expecting relative paths, and it just happened to work because in both cases Extension was initialized without a path. Modified page actions to use relative paths to be consistent with other images. Review URL: http://codereview.chromium.org/160516 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22368 0039d316-1c4b-4281-b951-d872f2087c98
* Put the null pointer check for theme images before we use thetc@google.com2009-08-031-1/+1
| | | | | | | | | | | pointer. This was crashing for me with the theme I had installed. Review URL: http://codereview.chromium.org/160550 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22342 0039d316-1c4b-4281-b951-d872f2087c98
* Pull all the filesystem manipulation out ofaa@chromium.org2009-07-281-0/+342
ExtensionsServiceBackend into a set of utility functions. The intent of this is: a) make extensions_service.cc smaller b) have smaller pieces hanging around that we can more easily reconfigure to implement new features. c) improve testability. Review URL: http://codereview.chromium.org/159400 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21920 0039d316-1c4b-4281-b951-d872f2087c98