summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ntp_background_util.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 01:58:01 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 01:58:01 +0000
commitb846afe7b1e97e4d245f7df153813c55ae46f74b (patch)
tree7e6ae6dda666d01ad1898a7d593bf9c0e606f5ca /chrome/browser/ntp_background_util.h
parentd2192e3d5b90b631abf219079d93c3453f852865 (diff)
downloadchromium_src-b846afe7b1e97e4d245f7df153813c55ae46f74b.zip
chromium_src-b846afe7b1e97e4d245f7df153813c55ae46f74b.tar.gz
chromium_src-b846afe7b1e97e4d245f7df153813c55ae46f74b.tar.bz2
GTK: Draw bottom-aligned ntp themes on floating bookmark bar.
This is a simplified version of the windows code. There will be a follow-up patch to switch windows over to using this as well. I ran into some trouble calculating the correct size of the tab contents. Punting on that for now, filed http://crbug.com/23907 BUG=22836 TEST=Tested on klassen, candies, karim rashid, tiesto, ratchet and clank, and jeff coons themes. Review URL: http://codereview.chromium.org/255086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28215 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ntp_background_util.h')
-rw-r--r--chrome/browser/ntp_background_util.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/ntp_background_util.h b/chrome/browser/ntp_background_util.h
new file mode 100644
index 0000000..9d2d656
--- /dev/null
+++ b/chrome/browser/ntp_background_util.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NTP_BACKGROUND_UTIL_H_
+#define CHROME_BROWSER_NTP_BACKGROUND_UTIL_H_
+
+class ThemeProvider;
+
+namespace gfx {
+class Canvas;
+class Rect;
+}
+
+class NtpBackgroundUtil {
+ public:
+ // Paints the NTP background on |canvas|. |area| is the area of the canvas
+ // that gets painted and also serves as the origin of the image (for top-
+ // aligned images). |tab_contents_height| is necessary for correctly painting
+ // bottom-aligned images since then the origin is the bottom of the web page.
+ static void PaintBackgroundDetachedMode(
+ ThemeProvider* tp, gfx::Canvas* canvas,
+ const gfx::Rect& area, int tab_contents_height);
+
+ private:
+ NtpBackgroundUtil() {}
+};
+
+#endif // CHROME_BROWSER_NTP_BACKGROUND_UTIL_H_