From 4426701e986b2345eb4741e02d7380374cb6f756 Mon Sep 17 00:00:00 2001 From: "oshima@chromium.org" Date: Mon, 23 Nov 2009 18:57:26 +0000 Subject: Adjust the position of the frame background image for ChromeOS to match gtk build. Gtk build is using non custom frame mode, which renders the frmae pixels 15 pixels above. I'll remove this hack once we migrate to views. BUG=28580 TEST=None Review URL: http://codereview.chromium.org/434011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32818 0039d316-1c4b-4281-b951-d872f2087c98 --- .../browser/views/frame/opaque_browser_frame_view.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc index 5851cf0..6d8f9ce 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc @@ -37,6 +37,10 @@ SkBitmap* OpaqueBrowserFrameView::distributor_logo_ = NULL; gfx::Font* OpaqueBrowserFrameView::title_font_ = NULL; +#if defined(OS_CHROMEOS) +const int kCustomFrameBackgroundVerticalOffset = 15; +#endif + namespace { // The frame border is only visible in restored mode and is hardcoded to 4 px on // each side regardless of the system window border size. @@ -690,7 +694,7 @@ void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { // Window frame mode and color SkBitmap* theme_frame; - + int y = 0; // Never theme app and popup windows. if (!browser_view_->IsBrowserTypeNormal()) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); @@ -702,14 +706,24 @@ void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { theme_frame = ShouldPaintAsActive() ? tp->GetBitmapNamed(IDR_THEME_FRAME) : tp->GetBitmapNamed(IDR_THEME_FRAME_INACTIVE); +#if defined(OS_CHROMEOS) + // TODO:(oshima): gtk based CHROMEOS is using non custom frame + // mode which does this adjustment. This should be removed + // once it's fully migrated to views. -1 is due to the layout + // difference between views and gtk and will be removed. + // See http://crbug.com/28580. + y = -kCustomFrameBackgroundVerticalOffset - 1; +#endif } else { theme_frame = ShouldPaintAsActive() ? tp->GetBitmapNamed(IDR_THEME_FRAME_INCOGNITO) : tp->GetBitmapNamed(IDR_THEME_FRAME_INCOGNITO_INACTIVE); +#if defined(OS_CHROMEOS) + y = -kCustomFrameBackgroundVerticalOffset - 1; +#endif } - // Draw the theme frame. - canvas->TileImageInt(*theme_frame, 0, 0, width(), theme_frame->height()); + canvas->TileImageInt(*theme_frame, 0, y, width(), theme_frame->height()); // Draw the theme frame overlay if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && -- cgit v1.1