summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-13 21:35:32 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-13 21:35:32 +0000
commit1a14188b1eb6a595da3e2f012e9223ca2b55f590 (patch)
tree2cb98728573b7f3cd5f778b69334a471e3a1a39e /chrome/common
parent73d00e88fde4c84c583fc9b04a0b2626f9f4b74a (diff)
downloadchromium_src-1a14188b1eb6a595da3e2f012e9223ca2b55f590.zip
chromium_src-1a14188b1eb6a595da3e2f012e9223ca2b55f590.tar.gz
chromium_src-1a14188b1eb6a595da3e2f012e9223ca2b55f590.tar.bz2
Make resource_bundle compile on Linux.
It's still missing implementations of many functions, but those will be easier to implement once we have the data file generation working, which Tony has underway. Review URL: http://codereview.chromium.org/17392 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/common.scons2
-rw-r--r--chrome/common/gfx/chrome_font.h4
-rw-r--r--chrome/common/gfx/chrome_font_skia.cc5
-rw-r--r--chrome/common/resource_bundle.cc3
-rw-r--r--chrome/common/resource_bundle.h5
5 files changed, 17 insertions, 2 deletions
diff --git a/chrome/common/common.scons b/chrome/common/common.scons
index 57f976e..34c5a05 100644
--- a/chrome/common/common.scons
+++ b/chrome/common/common.scons
@@ -70,6 +70,7 @@ input_files.extend([
'pref_service.cc',
'property_bag.cc',
'render_messages.cc',
+ 'resource_bundle.cc',
'resource_dispatcher.cc',
'sandbox_init_wrapper.cc',
'slide_animation.cc',
@@ -104,7 +105,6 @@ if env.Bit('windows'):
'os_exchange_data.cc',
'plugin_messages.cc',
'process_watcher.cc',
- 'resource_bundle.cc',
'security_filter_peer.cc',
'win_safe_util.cc',
'win_util.cc',
diff --git a/chrome/common/gfx/chrome_font.h b/chrome/common/gfx/chrome_font.h
index d4cc49f..f4b2a9a 100644
--- a/chrome/common/gfx/chrome_font.h
+++ b/chrome/common/gfx/chrome_font.h
@@ -115,8 +115,10 @@ class ChromeFont {
return dlus * font_ref_->height() / 8;
}
#elif defined(OS_LINUX)
- // We need a copy constructor to deal with the Skia reference counting.
+ // We need a copy constructor and assignment operator to deal with
+ // the Skia reference counting.
ChromeFont(const ChromeFont& other);
+ ChromeFont& operator=(const ChromeFont& other);
// Setup a Skia context to use the current typeface
void PaintSetup(SkPaint* paint) const;
#endif
diff --git a/chrome/common/gfx/chrome_font_skia.cc b/chrome/common/gfx/chrome_font_skia.cc
index 728893c..1b76a2d 100644
--- a/chrome/common/gfx/chrome_font_skia.cc
+++ b/chrome/common/gfx/chrome_font_skia.cc
@@ -14,6 +14,11 @@ ChromeFont::ChromeFont(const ChromeFont& other) {
CopyChromeFont(other);
}
+ChromeFont& ChromeFont::operator=(const ChromeFont& other) {
+ CopyChromeFont(other);
+ return *this;
+}
+
ChromeFont::ChromeFont(SkTypeface* tf, const std::wstring& font_name,
int font_size, int style)
: typeface_helper_(new SkAutoUnref(tf)),
diff --git a/chrome/common/resource_bundle.cc b/chrome/common/resource_bundle.cc
index ed15af8..c97f1b2 100644
--- a/chrome/common/resource_bundle.cc
+++ b/chrome/common/resource_bundle.cc
@@ -4,7 +4,9 @@
#include "chrome/common/resource_bundle.h"
+#if defined(OS_WIN)
#include <atlbase.h>
+#endif
#include "base/gfx/png_decoder.h"
#include "base/logging.h"
@@ -86,6 +88,7 @@ SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) {
bitmap.reset(LoadBitmap(theme_data_, resource_id));
#if defined(OS_WIN)
+ // TODO(port): refactor to remove this.
// If we did not find the bitmap in the theme DLL, try the current one.
if (!bitmap.get())
bitmap.reset(LoadBitmap(_AtlBaseModule.GetModuleInstance(), resource_id));
diff --git a/chrome/common/resource_bundle.h b/chrome/common/resource_bundle.h
index 9feff10..7af3ac8 100644
--- a/chrome/common/resource_bundle.h
+++ b/chrome/common/resource_bundle.h
@@ -19,6 +19,11 @@
#include "base/lock.h"
#include "base/scoped_ptr.h"
+#if defined(OS_LINUX)
+namespace base {
+ class DataPack;
+};
+#endif
class ChromeFont;
class SkBitmap;
class StringPiece;