summaryrefslogtreecommitdiffstats
path: root/app/resource_bundle.cc
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-09 01:07:42 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-09 01:07:42 +0000
commit4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f (patch)
tree69a1e9f78b3a5fa8b909cfab336826b09c44235f /app/resource_bundle.cc
parent5085ee0b4bfbe4625e63ee6975bb95702e13e0aa (diff)
downloadchromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.zip
chromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.tar.gz
chromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.tar.bz2
This is the first pass at themes.
This CL is paired with http://codereview.chromium.org/67284 This CL (for commit purposes) includes http://codereview.chromium.org/67284 BUG=4463,11232,11233,11234,11235 Review URL: http://codereview.chromium.org/99030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/resource_bundle.cc')
-rw-r--r--app/resource_bundle.cc46
1 files changed, 17 insertions, 29 deletions
diff --git a/app/resource_bundle.cc b/app/resource_bundle.cc
index c3d6923..85fd0b9 100644
--- a/app/resource_bundle.cc
+++ b/app/resource_bundle.cc
@@ -15,6 +15,22 @@
ResourceBundle* ResourceBundle::g_shared_instance_ = NULL;
/* static */
+// TODO(glen): Finish moving these into theme provider (dialogs still
+// depend on these colors).
+const SkColor ResourceBundle::frame_color =
+ SkColorSetRGB(77, 139, 217);
+const SkColor ResourceBundle::frame_color_inactive =
+ SkColorSetRGB(184, 209, 240);
+const SkColor ResourceBundle::frame_color_incognito =
+ SkColorSetRGB(83, 106, 139);
+const SkColor ResourceBundle::frame_color_incognito_inactive =
+ SkColorSetRGB(126, 139, 156);
+const SkColor ResourceBundle::toolbar_color =
+ SkColorSetRGB(210, 225, 246);
+const SkColor ResourceBundle::toolbar_separator_color =
+ SkColorSetRGB(182, 186, 192);
+
+/* static */
void ResourceBundle::InitSharedInstance(const std::wstring& pref_locale) {
DCHECK(g_shared_instance_ == NULL) << "ResourceBundle initialized twice";
g_shared_instance_ = new ResourceBundle();
@@ -51,39 +67,11 @@ void ResourceBundle::FreeImages() {
skia_images_.clear();
}
-void ResourceBundle::SetThemeExtension(const Extension& e) {
- theme_extension_.reset(new Extension(e));
-}
-
/* static */
SkBitmap* ResourceBundle::LoadBitmap(DataHandle data_handle, int resource_id) {
std::vector<unsigned char> raw_data, png_data;
bool success = false;
- // First check to see if we have a registered theme extension and whether
- // it can handle this resource.
- // TODO(erikkay): It would be nice to use something less brittle than
- // resource_id here.
- if (g_shared_instance_->theme_extension_.get()) {
- FilePath path =
- g_shared_instance_->theme_extension_->GetThemeResourcePath(resource_id);
- if (!path.empty()) {
- net::FileStream file;
- int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ;
- if (file.Open(path, flags) == net::OK) {
- int64 avail = file.Available();
- if (avail > 0 && avail < INT_MAX) {
- size_t size = static_cast<size_t>(avail);
- raw_data.resize(size);
- char* data = reinterpret_cast<char*>(&(raw_data.front()));
- if (file.ReadUntilComplete(data, size) == avail) {
- success= true;
- } else {
- raw_data.resize(0);
- }
- }
- }
- }
- }
+
if (!success)
success = LoadResourceBytes(data_handle, resource_id, &raw_data);
if (!success)