diff options
author | cira@chromium.org <cira@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 22:49:10 +0000 |
---|---|---|
committer | cira@chromium.org <cira@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 22:49:10 +0000 |
commit | ecabe6eed156a36238888bfd2fdb96ec4906f0a4 (patch) | |
tree | 9419d9a349fc940d45fa450b3a75169fdf48b39f /chrome/browser/extensions/extension_disabled_infobar_delegate.cc | |
parent | 7050861ff094fd74d155264b6da3ca3795543870 (diff) | |
download | chromium_src-ecabe6eed156a36238888bfd2fdb96ec4906f0a4.zip chromium_src-ecabe6eed156a36238888bfd2fdb96ec4906f0a4.tar.gz chromium_src-ecabe6eed156a36238888bfd2fdb96ec4906f0a4.tar.bz2 |
Loads local resources from current locale subtree if available, if not it 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
Diffstat (limited to 'chrome/browser/extensions/extension_disabled_infobar_delegate.cc')
-rw-r--r-- | chrome/browser/extensions/extension_disabled_infobar_delegate.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc index e3b0ca8..14cc3e7 100644 --- a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc +++ b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc @@ -7,11 +7,13 @@ #include "app/l10n_util.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/extensions/crx_installer.h" +#include "chrome/browser/extensions/extension_file_util.h" #include "chrome/browser/extensions/extension_install_ui.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/tab_contents/infobar_delegate.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/browser_list.h" +#include "chrome/common/extensions/extension_resource.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_service.h" #include "grit/generated_resources.h" @@ -28,7 +30,7 @@ class ExtensionDisabledDialogDelegate AddRef(); // balanced in ContinueInstall or AbortInstall. // Do this now because we can't touch extension on the file loop. - install_icon_path_ = + install_icon_resource_ = extension_->GetIconPath(Extension::EXTENSION_ICON_LARGE); ChromeThread::GetMessageLoop(ChromeThread::FILE)->PostTask(FROM_HERE, @@ -48,7 +50,8 @@ class ExtensionDisabledDialogDelegate private: void Start() { // We start on the file thread so we can decode the install icon. - CrxInstaller::DecodeInstallIcon(install_icon_path_, &install_icon_); + FilePath install_icon_path = install_icon_resource_.GetFilePath(); + CrxInstaller::DecodeInstallIcon(install_icon_path, &install_icon_); // Then we display the UI on the UI thread. ui_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, @@ -64,7 +67,7 @@ class ExtensionDisabledDialogDelegate Profile* profile_; ExtensionsService* service_; Extension* extension_; - FilePath install_icon_path_; + ExtensionResource install_icon_resource_; scoped_ptr<SkBitmap> install_icon_; MessageLoop* ui_loop_; }; |