summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 20:22:26 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 20:22:26 +0000
commit04537be0a183839472a8a3b6422cba17d56ba9b1 (patch)
treee68330190f2a1d69ba92bde2c9e054ab7d8e7754 /chrome/browser/download
parent6463cb2a117dcd866a12becb513cfdba935c16e5 (diff)
downloadchromium_src-04537be0a183839472a8a3b6422cba17d56ba9b1.zip
chromium_src-04537be0a183839472a8a3b6422cba17d56ba9b1.tar.gz
chromium_src-04537be0a183839472a8a3b6422cba17d56ba9b1.tar.bz2
Gets a couple of download classes to compile on linux. Updates the
views build so that we only include the gtk classes we need. BUG=none TEST=none Review URL: http://codereview.chromium.org/115788 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_util.cc19
-rw-r--r--chrome/browser/download/download_util.h8
2 files changed, 17 insertions, 10 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index df3fb82..e22821a 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -22,8 +22,11 @@
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkShader.h"
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
#include "app/os_exchange_data.h"
+#endif
+
+#if defined(OS_WIN)
#include "base/base_drag_source.h"
#include "views/drag_utils.h"
#endif
@@ -66,7 +69,7 @@ SkBitmap* g_foreground_32 = NULL;
SkBitmap* g_background_32 = NULL;
void PaintDownloadProgress(gfx::Canvas* canvas,
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
views::View* containing_view,
#endif
int origin_x,
@@ -96,7 +99,7 @@ void PaintDownloadProgress(gfx::Canvas* canvas,
gfx::Rect foreground_bounds(origin_x, origin_y,
foreground->width(), foreground->height());
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
// Mirror the positions if necessary.
int mirrored_x = containing_view->MirroredLeftPointForRect(background_bounds);
background_bounds.set_x(mirrored_x);
@@ -165,7 +168,7 @@ void PaintDownloadProgress(gfx::Canvas* canvas,
}
void PaintDownloadComplete(gfx::Canvas* canvas,
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
views::View* containing_view,
#endif
int origin_x,
@@ -183,7 +186,7 @@ void PaintDownloadComplete(gfx::Canvas* canvas,
gfx::Rect complete_bounds(origin_x, origin_y,
complete->width(), complete->height());
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
// Mirror the positions if necessary.
complete_bounds.set_x(
containing_view->MirroredLeftPointForRect(complete_bounds));
@@ -230,9 +233,10 @@ int GetBigProgressIconOffset() {
return (GetBigProgressIconSize() - kBigIconSize) / 2;
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
// Download dragging
void DragDownload(const DownloadItem* download, SkBitmap* icon) {
+#if defined(OS_WIN)
DCHECK(download);
// Set up our OLE machinery
@@ -247,6 +251,9 @@ void DragDownload(const DownloadItem* download, SkBitmap* icon) {
DWORD effects;
DoDragDrop(data.get(), drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK,
&effects);
+#else
+ NOTIMPLEMENTED();
+#endif
}
#endif
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index f187706..bd43e67 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -14,7 +14,7 @@
#include "base/basictypes.h"
#include "base/task.h"
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
#include "views/view.h"
#endif
@@ -98,7 +98,7 @@ enum PaintDownloadProgressSize {
// drawing in a right-to-left locale, we need to mirror the position of the
// progress animation within the containing View.
void PaintDownloadProgress(gfx::Canvas* canvas,
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
views::View* containing_view,
#endif
int origin_x,
@@ -108,7 +108,7 @@ void PaintDownloadProgress(gfx::Canvas* canvas,
PaintDownloadProgressSize size);
void PaintDownloadComplete(gfx::Canvas* canvas,
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
views::View* containing_view,
#endif
int origin_x,
@@ -116,7 +116,7 @@ void PaintDownloadComplete(gfx::Canvas* canvas,
double animation_progress,
PaintDownloadProgressSize size);
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
// Drag support ----------------------------------------------------------------
// Helper function for download views to use when acting as a drag source for a