summaryrefslogtreecommitdiffstats
path: root/chrome/common/resource_bundle_linux.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-17 22:43:02 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-17 22:43:02 +0000
commitb7125fd56addf151194b09314c1f7f2c9d03a5b9 (patch)
treeca6a7f9d67fcc1dfda7feac741fe632843e563f7 /chrome/common/resource_bundle_linux.cc
parent7aea7093469f7c88b7a58bbe7c475b225802c852 (diff)
downloadchromium_src-b7125fd56addf151194b09314c1f7f2c9d03a5b9.zip
chromium_src-b7125fd56addf151194b09314c1f7f2c9d03a5b9.tar.gz
chromium_src-b7125fd56addf151194b09314c1f7f2c9d03a5b9.tar.bz2
Hook up theme images and chrome resource data on linux.
Go ahead and convert our toolbar buttons to using the theme data pack file. Review URL: http://codereview.chromium.org/20433 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/resource_bundle_linux.cc')
-rw-r--r--chrome/common/resource_bundle_linux.cc23
1 files changed, 18 insertions, 5 deletions
diff --git a/chrome/common/resource_bundle_linux.cc b/chrome/common/resource_bundle_linux.cc
index 1696402..1cb8307 100644
--- a/chrome/common/resource_bundle_linux.cc
+++ b/chrome/common/resource_bundle_linux.cc
@@ -4,7 +4,9 @@
#include "chrome/common/resource_bundle.h"
+#include "base/base_paths.h"
#include "base/data_pack.h"
+#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
@@ -26,9 +28,16 @@ ResourceBundle::~ResourceBundle() {
}
void ResourceBundle::LoadResources(const std::wstring& pref_locale) {
- // TODO(tc): Load the .pak files to locale_resources_data_ and
- // resources_data_.
- NOTIMPLEMENTED();
+ FilePath resources_data_path;
+ PathService::Get(base::DIR_EXE, &resources_data_path);
+ resources_data_path = resources_data_path.Append(
+ FILE_PATH_LITERAL("chrome.pak"));
+ DCHECK(resources_data_ == NULL) << "resource data already loaded!";
+ resources_data_ = new base::DataPack;
+ bool success = resources_data_->Load(resources_data_path);
+ DCHECK(success) << "failed to load chrome.pak";
+
+ // TODO(tc): Load the .pak file for locale_resources_data_.
}
FilePath ResourceBundle::GetLocaleFilePath(const std::wstring& pref_locale) {
@@ -43,8 +52,12 @@ FilePath ResourceBundle::GetLocaleFilePath(const std::wstring& pref_locale) {
}
void ResourceBundle::LoadThemeResources() {
- // TODO(tc): Load the theme .pak file.
- NOTIMPLEMENTED();
+ FilePath theme_data_path;
+ PathService::Get(chrome::DIR_THEMES, &theme_data_path);
+ theme_data_path = theme_data_path.Append(FILE_PATH_LITERAL("default.pak"));
+ theme_data_ = new base::DataPack;
+ bool success = theme_data_->Load(theme_data_path);
+ DCHECK(success) << "failed to load theme data";
}
/* static */